【timeisprecious】【JavaScript 】JavaScript对象

 

 JavaScript 对象

 

 

 

 

var a=[];console.log(new Boolean(a));
VM1319:1 Boolean {true}
undefined
var a=[];console.log(new Boolean(!!a));
VM1334:1 Boolean {true}
undefined
var a=null;console.log(new Boolean(!!a));
VM1337:1 Boolean {false}
undefined
var a=undefined;console.log(new Boolean(!!a));
VM1340:1 Boolean {false}
undefined
var a='';console.log(new Boolean(!!a));
VM1341:1 Boolean {false}
undefined
var a='  ';console.log(new Boolean(!!a));
VM1342:1 Boolean {true}
undefined
var a='  ';console.log(new Boolean(a));
VM1355:1 Boolean {true}
undefined
var a='  ';if(a){console.log(111)}
VM1376:1 111
undefined

 

posted @ 2019-03-07 20:47  WhoKnows1  阅读(133)  评论(0编辑  收藏  举报