falsy

下面哪些值是 falsy?

0
new Number(0)
('')
(' ')
new Boolean(false)
undefined
  • A: 0, '', undefined

  • B: 0, new Number(0), '', new Boolean(false), undefined

  • C: 0, '', new Boolean(false), undefined

  • D: All of them are falsy

最后更新于