第一种:json.stringify
var a = {}; console.log(JSON.stringify(a) == '{}');
第二种:es6的Object.keys
var a = {};
var b = Object.keys(b);
console.log(b.length)
第三种:for in
var a= {}; var b= true; // 空 for(var key in a) { return false; // 非空 } console.log(b);
标签:13,12,console,log,keys,Object,stringify,为空,var From: https://www.cnblogs.com/iuniko/p/16977865.html