The most terrifying Javascript I've seen yet...

Posted on Fri 11 October 2013 in Code

There was a recent discussion on the Clojure mailing list about dynamically and statically typed languages. Someone posted this terrifying example of Javascript to show what happens at the extremes of type coercion:

js> Array(16).join("wat" - 1) + " Batman!"
"NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!"
js>