JavaScript: “[] ==! [] // true?”


Why is the output of [] ==! [] // true? Why does a certain combination of brackets, square brackets, exclamation marks and plus signs cause the output ‘fail’? What is the baNaNa Joke all about? This entertaining find is about such and other exciting, funny and strange cases. 

JavaScript is one of the most popular programming languages . The syntax is relatively simple compared to languages ​​like Java or C. The JavaScript ecosystem and the community are growing continuously. There is an abundance of frameworks and tools, and the demand for JavaScript developers is high.

Programming language with pitfalls

With all the advantages, the programming language also has its pitfalls. Some of them make your developer job hell, others are just pretty funny – that’s how the creator of the WTF JavaScript repo, Denys Dovan, introduces the collection. He was inspired by Brian Leroux’s talk at dotJS 2012.

In the repository, in addition to a few introductory sentences and notes on the notation, you will find a table of contents with a large number of examples, which are also explained really well and in detail. Often, further sources are also linked to deepen them.

Command Line ftw

Friends of the command line can WTF JavaScript on npm install -g wtfjs install, via wtfjs open and call the pager of their choice via the terminal. All others can just call the repo on GitHub .

Look under the hood

The motivation behind the list is as follows: Dovan wanted to use WTF JavaScript to create a collection of strange, unexpected and interesting functions of the programming language – and explain what was behind it. Simply because it’s fun to learn something new more often. The project offers a great resource for beginners to take a closer look at the idiosyncrasies of the language and take a look under the hood. For experienced JS developers it is a great reference for JavaScripts strange peculiarities. It is quite possible that this faction can also learn something. No matter which of the two groups you belong to – read the repository, it’s worth it.

Share This:

Leave A Reply

%d bloggers like this:

Powered by FrontNet