js判断对象是否为{}

var obj={};

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

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

}

 

posted @ 2021-03-05 17:19  於生  阅读(558)  评论(0编辑  收藏  举报