JS判断对象是否为空
let obj1 = {};
let obj2 = {user: '小明', age: 26};
console.log(JSON.stringify(obj1) == '{}'); // true
console.log(JSON.stringify(obj2) == '{}'); // false
let obj1 = {};
let obj2 = {user: '小明', age: 26};
console.log(JSON.stringify(obj1) == '{}'); // true
console.log(JSON.stringify(obj2) == '{}'); // false