TypeOfNaN JavaScript Quizzes |
Written by Nikos Vaggalis | |||
Monday, 16 March 2020 | |||
Learn JavaScript fundamentals through fun and challenging quizzes! This interactive quiz provides a total hands-on learning experience. It currently has 72 questions on a variety of Javascript concepts and more are being added. These quizzes have been set by Nick Scialli who explains that many of them are tricky and dive into subjects that tripped him up when he was first learning JavaScript. The very first question should give you an idea of what to expect: Array Sort Comparison Consider the following arrays. What gets logged in various sorting conditions?
The question is followed by multiple choice answers: true true true After you make your choice, be it right or wrong, an explanation is provided : There are a couple concepts at play here. First, the array sort method sorts your original array and also returns a reference to that array. This means that when you write arr2.sort(), the arr2 array object is sorted. It turns out, however, the sort order of the array doesn't matter when you're comparing objects. Since arr1.sort() and arr1 point to the same object in memory, the first equality test returns true. This holds true for the second comparison as well: arr2.sort() and arr2 point to the same object in memory. In the third test, the sort order of arr1.sort() and arr2.sort() are the same; however, they still point to different objects in memory. Therefore, the third test evaluates to false.
In this question, we have a Dog constructor function. Our dog obviously knows the speak command. What gets logged in the following example when we ask Pogo to speak?
Every time we create a new Dog instance, we set the speak property to that instance to be a function returning the string woof. Since this is being set every time we create a new Dog instance, we never use the prototypal speak property on Dog that returns the arf string. Others quizzes include :
and so on. As the list indicates, the quiz is addressed to the intricacies of the language and spans important and tricky concepts that you need firmly established foundation of in order to progress further with the language. Nick Scialli does warn however: I'm considered a senior developer and would probably have trouble with a lot of these questions had I not made them myself. Please don't be hard on yourself as you attempt these questions; we're all still learning! Scialla also offers the quiz as a self hosted option so that you can adapt it to a local network (i.e corporate environment) or even make your own for educational purposes, simply by cloning its Gitgub repo. Enjoy!
More InformationTypeOfNaN JavaScript Quizzes-Github Related ArticlesLInQer ports .NET LINQ to Javascript Learn Ramda.js The Interactive Way
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.
{laodposition comment} |
|||
Last Updated ( Monday, 16 March 2020 ) |