This is WAT makes TypeScript good

By now I’m sure you have all seen the hilarious WAT video, but if not here it is for your viewing pleasure:

The very first question that the speaker Gary Bernhardt poses (after the Ruby parts) is that of what is expected when you execute the following javascript:

[ ] + [ ]

He says in that video that he would expect an empty array to result or he would also accept a Type error. But what you actually get when this is run is an empty string. Then we all WAT and laugh. He shows a few other examples of questionable things that javascript will do without any problems whatsoever.

So lets take this famous WAT-inducing example over to the TypeScript playground and lets see what happens…

Type error! So this is wat makes TypeScript good 🙂