js判断对象是否为{}

var obj={};

if(JSON.stringify(obj) == "{}"){

    console.log("obj为:{}");

}
原文地址:https://www.cnblogs.com/lyso/p/14487365.html