mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-08 17:10:06 +08:00
doc(angular.forEach): note difference from ES262's Array.prototype.forEach
Since Angular's forEach is not a strict polyfill, and takes different paths depending on the type of collection it is dealing with, it does not throw a TypeError when converting the obj with ToObject(), as this operation does not need to be performed. This difference is documented nicely here. Closes #9142
This commit is contained in:
committed by
Caitlin Potter
parent
02aa4f4b85
commit
6502ab0977
@@ -221,6 +221,11 @@ function isArrayLike(obj) {
|
||||
*
|
||||
* It is worth noting that `.forEach` does not iterate over inherited properties because it filters
|
||||
* using the `hasOwnProperty` method.
|
||||
*
|
||||
* Unlike ES262's
|
||||
* [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
|
||||
* Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
|
||||
* return the value provided.
|
||||
*
|
||||
```js
|
||||
var values = {name: 'misko', gender: 'male'};
|
||||
|
||||
Reference in New Issue
Block a user