kun-galgame-vue/server/util.js
2023-06-12 13:32:55 +08:00

15 lines
363 B
JavaScript

module.exports = {
// 遍历对象
objForEach: function (obj, fn) {
let key, result
for (key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
result = fn.call(obj, key, obj[key])
if (result === false) {
break
}
}
}
},
}