Skip to content
Retr0 Academy
JavaScript

JavaScript · 10 questions

JavaScript quiz

Answer every question, then score the quiz. The result is saved in this browser.

1. Which keyword declares a variable that cannot be reassigned?
2. What does `typeof 42` return?
3. What is the result of `5 === "5"`?
4. Which of these values is falsy?
5. What does this arrow function return: `const double = (n) => n * 2; double(4);`
6. Given `const a = ["x", "y", "z"];`, what is `a[1]`?
7. What does `[1, 2, 3, 4].filter((n) => n > 2)` return?
8. Which method converts a JavaScript object into a JSON string?
9. Why is `textContent` safer than `innerHTML` for showing user input?
10. When does a `fetch` promise reject?