当用==操作符将false对象和其他对象进行比较的时候
只有0和空字符串、空数组等于false;
undefined和null对象并不等于false对象,而null和undefined是相等的。
let completed = false; console.log(completed == 0); console.log(completed == ''); console.log(completed == []); console.log(completed == null); console.log(completed == undefined); console.log(null == undefined);
标签:false,log,completed,js,console,null,true,undefined From: https://www.cnblogs.com/ZhaoHS/p/17667143.html