Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ed4a70e

Browse files
docs(Angular.js): move forEach docs to correct position
1 parent 1866968 commit ed4a70e

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/Angular.js

+23-24
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@ var /** holds major version number for IE or NaN for real browsers */
6161
nodeName_,
6262
uid = ['0', '0', '0'];
6363

64+
65+
/**
66+
* @private
67+
* @param {*} obj
68+
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
69+
*/
70+
function isArrayLike(obj) {
71+
if (!obj || (typeof obj.length !== 'number')) return false;
72+
73+
// We have on object which has length property. Should we treat it as array?
74+
if (typeof obj.hasOwnProperty != 'function' &&
75+
typeof obj.constructor != 'function') {
76+
// This is here for IE8: it is a bogus object treat it as array;
77+
return true;
78+
} else {
79+
return obj instanceof JQLite || // JQLite
80+
(jQuery && obj instanceof jQuery) || // jQuery
81+
toString.call(obj) !== '[object Object]' || // some browser native object
82+
typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj)
83+
}
84+
}
85+
86+
6487
/**
6588
* @ngdoc function
6689
* @name angular.forEach
@@ -88,30 +111,6 @@ var /** holds major version number for IE or NaN for real browsers */
88111
* @param {Object=} context Object to become context (`this`) for the iterator function.
89112
* @returns {Object|Array} Reference to `obj`.
90113
*/
91-
92-
93-
/**
94-
* @private
95-
* @param {*} obj
96-
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
97-
*/
98-
function isArrayLike(obj) {
99-
if (!obj || (typeof obj.length !== 'number')) return false;
100-
101-
// We have on object which has length property. Should we treat it as array?
102-
if (typeof obj.hasOwnProperty != 'function' &&
103-
typeof obj.constructor != 'function') {
104-
// This is here for IE8: it is a bogus object treat it as array;
105-
return true;
106-
} else {
107-
return obj instanceof JQLite || // JQLite
108-
(jQuery && obj instanceof jQuery) || // jQuery
109-
toString.call(obj) !== '[object Object]' || // some browser native object
110-
typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj)
111-
}
112-
}
113-
114-
115114
function forEach(obj, iterator, context) {
116115
var key;
117116
if (obj) {

0 commit comments

Comments
 (0)