JS 能力自测题

计算下列表达式的值

  • 1 + 1
  • 1 + 2 + "3" + 4 + 5
  • 1e2.toFixed(2)
  • NaN != NaN
  • 1 / 0 < 2 / 0
  • [0][0]
  • [0, 1][0, 1]
  • [0, 1, 2][0, 1, 2]
  • [] != []
  • 1 + { valueOf(){ return 1 } }
  • "1" + { toString(){ return "1" } }
  • parseInt(Infinity)
  • null == null
  • ![]
  • +[]
  • "123".split("")
  • "xuld222".substr(2,3)
  • [] instanceof Array
  • "" instanceof String
  • "我C".length
  • [1, 2, 3, 4, 5, 6].splice(2,3)
  • "asas".replace("s","a")
  • 1 / 0
  • 0 || 2
  • [] && {}
  • ~~2.99999999
  • 84.01 + 0.2 == 84.21
  • 3 > 2 > 1
  • null instanceof Object
  • Object instanceof Function
  • Function instanceof Object
  • [1, 2, 3].slice.call([4, 5, 6], 1)
  • typeof typeof true
  • 0 == ""
  • 0 == false
  • [] == false
  • 1 - 2 - "3" - 4 - 5
  • [1, 2, 3].reverse().map(t => t)
  • new Date("1990/12/6").getMonth()
  • "\r" == "\n"
  • 0xFF == 0xff
  • "\u0009" == "\t"
  • 2 & 3
  • 4 << 3
  • 1 && 2 || 3
  • 0 && 1 || 2
  • 1 || 2 && 3
  • 0 || 1 && 2
  • [0][0][0]
  • [1, ...[2]]
  • (t => t + 1)(t => t + 1)
  • [1, 2, 3].shift()
打赏
微信扫一扫支付
这篇文章对你有用?
微信logo 微信扫一扫,打赏 1 元表示支持吧~

发表评论

电子邮件地址不会被公开。