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

Commit 04d4c73

Browse files
alexpodspetebacondarwin
authored andcommitted
docs(Angular.js) move forEach docs to correct place
1 parent 4ae4f1e commit 04d4c73

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

src/Angular.js

+21-24
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ function noConflict() {
8181
return a;
8282
}
8383

84+
/**
85+
* @private
86+
* @param {*} obj
87+
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
88+
*/
89+
function isArrayLike(obj) {
90+
if (!obj || (typeof obj.length !== 'number')) return false;
91+
92+
// We have on object which has length property. Should we treat it as array?
93+
if (typeof obj.hasOwnProperty != 'function' &&
94+
typeof obj.constructor != 'function') {
95+
// This is here for IE8: it is a bogus object treat it as array;
96+
return true;
97+
} else {
98+
return obj instanceof JQLite || // JQLite
99+
(jQuery && obj instanceof jQuery) || // jQuery
100+
toString.call(obj) !== '[object Object]' || // some browser native object
101+
typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj)
102+
}
103+
}
104+
84105
/**
85106
* @ngdoc function
86107
* @name angular.forEach
@@ -108,30 +129,6 @@ function noConflict() {
108129
* @param {Object=} context Object to become context (`this`) for the iterator function.
109130
* @returns {Object|Array} Reference to `obj`.
110131
*/
111-
112-
113-
/**
114-
* @private
115-
* @param {*} obj
116-
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
117-
*/
118-
function isArrayLike(obj) {
119-
if (!obj || (typeof obj.length !== 'number')) return false;
120-
121-
// We have on object which has length property. Should we treat it as array?
122-
if (typeof obj.hasOwnProperty != 'function' &&
123-
typeof obj.constructor != 'function') {
124-
// This is here for IE8: it is a bogus object treat it as array;
125-
return true;
126-
} else {
127-
return obj instanceof JQLite || // JQLite
128-
(jQuery && obj instanceof jQuery) || // jQuery
129-
toString.call(obj) !== '[object Object]' || // some browser native object
130-
typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj)
131-
}
132-
}
133-
134-
135132
function forEach(obj, iterator, context) {
136133
var key;
137134
if (obj) {

0 commit comments

Comments
 (0)