判断对象是否为空 风_吟 2022-08-19 84 阅读1分钟 Object.keys(obj).length === 0 JSON.stringify(obj) === '{}'\ 第二个方法有缺陷,当属性值为undefined或function(),返回值依旧为true。\ 如下例: