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.
- Explain scoping in JavaScript! Enumerate the different types of scopes you know. (6 points)
- Explain hoisting with one or more examples including
var
andlet
variables. What is the temporal dead zone? (6 points) - Explain the role of the
prototype
property via an example! (5 points) - Extend your example from question 3 to demonstrate prototypal inheritance! (5 points)
- Use the ES6 class syntax to rewrite the code you wrote in questions 3 and 4. (7 points)
- Explain the
this
value in JavaScript! Illustrate your explanation with an example! (6 points) - Explain context binding using an example. (3 points)
- 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
andundefined
,NaN
to itself- 5 to
'5'
(6 points)
- How can you check if a variable is an array? (2 points)
- 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.