All quizzes
Free quiz · 104 questions in the bank

JavaScript quiz

Test your JavaScript knowledge with a free interactive quiz — 104 questions with answers and explanations. No signup needed to play.

Question 1/12Score 0

What is the value of `b` after `const a = {x: 1}; const b = {...a, y: 2};`?

In this round
  1. What is the value of `b` after `const a = {x: 1}; const b = {...a, y: 2};`?
  2. What does `"hello world".includes("world")` return?
  3. How do you import a default export from `./math.js`?
  4. What does `user?.profile?.name` evaluate to if `user.profile` is `null`?
  5. Which method converts a JSON string into a JavaScript object?
  6. What does the `this` keyword refer to inside a regular function called in the global scope in non-strict mode?
  7. What does spread do in a function call: `Math.max(...[1, 2, 3])`?
  8. Which keyword is used to declare a block-scoped variable in modern JavaScript?
  9. What does this print? ```js const obj = {a: 1}; obj.a = 2; console.log(obj.a); ```
  10. What is the value of `third` after `const [, , third] = [10, 20, 30];`?
  11. What does `extends` do in a class declaration?
  12. How do you declare an arrow function?
Gaps to close?
Read the curated JavaScript notes — core concepts, patterns, interview prep.
JavaScript notes

More quizzes

.NETAccessibilityAgile MethodologyAlertmanagerAlgorithmsAndroid