logoalt Hacker News

moritzwarhiertoday at 3:45 PM2 repliesview on HN

To be fair there were a couple of disasters, such as [object Array] and undefined.

Feels like the world is hanging on a single thread by now.


Replies

sheepttoday at 7:09 PM

You probably meant [object Object] :) Since arrays have their own default toString implementation (its own can of worms that is the basis for JSFuck[0]), you'd have to go out of your way with Object.prototype.toString.call to get [object Array]

[0]: https://jsfuck.com/ relies on Array#toString for casting values to strings

show 1 reply
jschrftoday at 5:16 PM

Protip: never even mention undefined in your codebase. Erase it from your vernacular. If you ever need to pass or return nothing, you use null.

show 4 replies