!!在js中的用法

var obj = ""; //undefined
console.log(!!obj);  //false(强制转换成Boolean类型)

posted @ 2019-01-18 15:26  刘丑丑鱼香肉丝  阅读(353)  评论(0编辑  收藏  举报