You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
module.exports = {
|
|
// 遍历对象
|
|
objForEach: function (obj, fn) {
|
|
let key, result
|
|
for (key in obj) {
|
|
if (obj.hasOwnProperty(key)) {
|
|
result = fn.call(obj, key, obj[key])
|
|
if (result === false) {
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |