Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN and undefined in left-hand side expressions, and some Number.NaN stuff #84

Open
0joshuaolson1 opened this issue May 24, 2018 · 0 comments

Comments

@0joshuaolson1
Copy link

@0joshuaolson1 0joshuaolson1 commented May 24, 2018

NaN++ // NaN
0/0 // NaN
(0/0)++ // invalid lhs, but [0/0][0]++ works of course
NaN = void 0 // undefined
--undefined // NaN
--void 0 // invalid lhs

Bonus fun with the read-only Number.NaN property:

Object.is(Number.NaN, Number.NaN) // true
Object.is(Number.NaN, NaN) // true
Object.is(NaN, NaN) // true
Number[NaN] // NaN
Number = {NaN: 0} // works in browsers (modifies window.Number), but reassigning Number crashes Node.js v10.2.0 with "TypeError: Number.isSafeInteger is not a function"
Number.NaN // 0
Number.NaN = 1 // 1
Number.NaN // 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.