console.log(!!" " + !!"" - !!false || "未通过")
字符串中有空格,是真,前面两个叹号,是假之后真,结果是true true是1
window.a || (window.a = "1")
console.log(window.a)
或运算符 前面是假, window.a是undefined, 是假,所以往后走 赋值 ,在这个题中是错的。
原文:https://www.cnblogs.com/easth/p/about_interview.html