JavaScript Theory Quiz

Take the quiz and find out how much you know about JavaScript!

A JavaScript interview often consists of fundamental JavaScript theory questions. Although it is not possible to cover everything about JavaScript, this post will give you an opportunity to test your knowledge.

You have probably seen that most tests contain questions that are a bit outdated. This test reflects 2017-18 standards, which means that you can, and sometimes you have to make use of your ES6 knowledge.

I suggest answering the questions one by one, so that you can grade yourself. Once you figure out your shortcomings, you can construct a learning plan for yourself.

Questions

Without looking at the solutions, you can access all ten questions at once here. I encourage you to solve the exercises on your own. Take out your favorite text editor or a piece of paper, and write down your answers. At first, do not use Google.

  1. Explain scoping in JavaScript! Enumerate the different types of scopes you know. (6 points)
  2. Explain hoisting with one or more examples including var and let variables. What is the temporal dead zone? (6 points)
  3. Explain the role of the prototype property via an example! (5 points)
  4. Extend your example from question 3 to demonstrate prototypal inheritance! (5 points)
  5. Use the ES6 class syntax to rewrite the code you wrote in questions 3 and 4. (7 points)
  6. Explain the this value in JavaScript! Illustrate your explanation with an example! (6 points)
  7. Explain context binding using an example. (3 points)
  8. Explain the difference between == and === in general. Determine the result of a comparison, when two values are:
    • of the same type (for all types)
    • null and undefined,
    • NaN to itself
    • 5 to '5' (6 points)
  9. How can you check if a variable is an array? (2 points)
  10. Suppose we would like to detect if a variable is an object using the following code. What can go wrong? How would you fix this error? (4 points)

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.