前端隐式判断语句
dearweb 发布:2023-03-31 19:19:26阅读:前端js的判断,下面这些有多少你了解
let a = ({} + {})
let b = 2 * {}
let c = [] == !{}
let d = !!{}
let e = !!undefined
let f = NaN==NaN
let g = {}=={}
let h = '1' + 1
let i = 5 - undefined
let j = 5 - '1'
console.log(a,b,c,d,e,f,g,h,i,j) // [object Object][object Object] NaN true true false false false 11 NaN 4
小礼物走一波,支持作者
赏还没有人赞赏,支持一波吧