mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
perf(map): use Array.prototype.map
Replace helper functions with the native ES5 method
This commit is contained in:
committed by
Brian Ford
parent
6b05105c08
commit
a591e8b8d3
@@ -50,7 +50,6 @@
|
||||
trim: true,
|
||||
isElement: true,
|
||||
makeMap: true,
|
||||
map: true,
|
||||
size: true,
|
||||
includes: true,
|
||||
arrayRemove: true,
|
||||
@@ -617,15 +616,6 @@ function nodeName_(element) {
|
||||
}
|
||||
|
||||
|
||||
function map(obj, iterator, context) {
|
||||
var results = [];
|
||||
forEach(obj, function(value, index, list) {
|
||||
results.push(iterator.call(context, value, index, list));
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description
|
||||
* Determines the number of elements in an array, the number of properties an object has, or
|
||||
|
||||
Reference in New Issue
Block a user