Test Your Knowledge With The JS Is Weird Quiz
Written by Nikos Vaggalis   
Friday, 08 September 2023

How well do you know JavaScript? Put your knowledge to test with the interactive quiz tailored to devs who think they know it all. 

It is true that all web applications are directly written or are transpiled to JavaScript. It does really drives the web because it's easy to get started with and with it you can make functional web sites quickly and without much ado.

To that end most people employ the 'standard' language feature and never look back. However, the language is more powerful and nuanced if you look just under the tip of the iceberg as the language's subtleties can really trip you up in unexpected ways.

Many people for example get confused by:

  • Which equals operator (== vs ===) should be used in comparisons?
  • What is the difference between null and undefined?
  • Concatenations: what will
       1 + "1" or 1 - "1"
    produce?
  • What are the variable scopes? let, var and const have different scopes
  • Three-way comparison
      1 < 2 < 3; //true
      3 > 2 > 1; //false
    why is that so?

and so on.

The "JS Is Weird" quiz goes beyond the ordinary usage of the language. It is comprised of 25 mind bending questions
that will make you question your knowledge of the language. For instance, I know of a great, great programmer
who solved 14 out of 25. Is it really so difficult? Let's find out.

jsQuiz

The quiz begins with "easy" questions like the very first one :

what does "true + false" make ?

pick your choice!

jsweird

and steadily increases the difficulty level, i. e what give the following?

!!""

or

"" - - ""

Towards then end it peaks with questions like

undefined + false

or

+!!NaN * "" - - [, ]

Upon completion, you are presented with a nice overview of which problems you solved and which you failed, along
with the actual explanation and correct answer.

Admittedly most of the quiz questions no one will encounter in their day to day programming as they mostly look like parts of an obfuscation context. However, the point is that the quiz goes to highlight the depths that this nevertheless simplistic language can get to. If on the other hand you managed to get the most or all correctly then you are a true Hacker.

If you do find this quiz useful or fun you might also want to check the wfjs Github repo which hosts many more funny and tricky JavaScript examples.

If you want to explore JavaScript in greater depth have a look at Just JavaScript: An Idiomatic Approach and JavaScript Jems: The Amazing Parts, two titles from the I Programmer Library - and you'll find lots of extracts from them in our JavaScript section.

javascript image

 

More Information

JS is weird

WtfJs

Related Articles

Learn JavaScript and Node.js With Microsoft

js1024 - How Much Awesomeness Can You Pack In Just 1K?

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Pico 2W Announced But There Is A Surprise!
25/11/2024

Raspberry Pi released the Pico 2 a few months ago and we have been waiting for the Pico 2W since then. But Pimoroni beat them to the draw with the Pico Plus 2W based on the RM2 radio module and hinted [ ... ]



Windows 11 Adoption Takes A Downturn
11/12/2024

With Windows 10 End of Life only ten months away, Microsoft is stepping up its campaign to get Windows users to upgrade to Windows 11. But while Windows 11 had been gaining users at a steady rate at t [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1871962579>

<ASIN:1871962420>

Last Updated ( Friday, 08 September 2023 )