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


Ursina - A Game Engine Powered by Python
08/11/2024

Ursina is a new open source game engine in which you can code any type of game in Python, be it 2-D, 3-D, an application, a visualization, you name it.



Extend NGINX With The New JavaScript Module
28/10/2024

Inject middleware functionality into NGINX with the expressive power of Javascript. NGINX JavaScript or NJS for short is a dynamic module under which you can use scripting for hooking into the NGINX e [ ... ]


More News

espbook

 

Comments




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

<ASIN:1871962579>

<ASIN:1871962420>

Last Updated ( Friday, 08 September 2023 )