x !== x 返回true
1 | const x = ? // Please fill in the value of "x? |
如果你有仔细阅读 es6 的教程的话,就知道这个问题是一个典型的demo
1 | const x = NaN // Please fill in the value of "x? |
(!isNan(x) && x !== x) 返回 true
现在难度提高
1 | const x = ? // Please fill in the value of "x? |
你知道 Object.defineProperty() 吗?
请参考Object.defineProperty() - JavaScript | MDN
1 | window.x = 0 // Any value is OK |
如何使得 x === x+1
使用极大值 Number.MAX_SAFE_INTERGER
参考 Number.MAX_SAFE_INTEGER - JavaScript | MDN
1 | const x = Number.MAX_SAFE_INTEGER + 1// Please fill in the value of "x? |
如何使得 x > x
使用 Symbol.toPrimitive
1 | const x = { // Please fill in the value of "x? |
实现 typeof x === ‘undefined’ && x.length > 0
答案是 document.all()
1 | const x = document.all // Please fill in the value of "x? |
