Javascript Nonsense
Javascript is nonsense. Period. Often, I never found enough motivate to looking for way to express the frustration or a ways to mock it. Then I came across this video which talks about Python and some JS.
So, fire up you Firefox/Chrome console. Here’s some guessing game from the video:
What’s the results of (click to reveal answer):
1. [] + []
"" // empty string
2. [] + {}
[object Object] // an object
3. {} + []
0 // a number
4. {} + {}
NaN
5. Array(16).join("wat" + 1)
wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1wat1
6. Array(16).join("wat" - 1) + " Batman!"
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!