Skip to content

判断空对象

isPlainObject(纯粹的对象:通过 "{}" 或者 "new Object" 创建的)

js
let dataObject = {};
console.log(Object.keys(dataObject).length == 0); // true

MIT Licensed | 沪ICP备20013265号-1 | Copyright © 2019-present AaronKong