dont use global variable
This commit is contained in:
parent
b60f0c8791
commit
3eab11e967
1 changed files with 1 additions and 0 deletions
|
@ -746,6 +746,7 @@ Ox.map = function(obj, fn) {
|
||||||
var isObject = Ox.isObject(obj),
|
var isObject = Ox.isObject(obj),
|
||||||
ret = isObject ? {} : [];
|
ret = isObject ? {} : [];
|
||||||
Ox.forEach(obj, function(val, key) {
|
Ox.forEach(obj, function(val, key) {
|
||||||
|
var v;
|
||||||
if ((v = fn(val, key)) !== null) {
|
if ((v = fn(val, key)) !== null) {
|
||||||
ret[isObject ? key : ret.length] = v;
|
ret[isObject ? key : ret.length] = v;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue