JavaScript Basics for Beginners

Test your understanding of variables,functions,and loops in JS.

1. Which keyword is used to declare a block-scoped variable in JavaScript?
2. Which of the following are primitive data types in JavaScript? (Select all that apply)
3. JavaScript is a statically typed programming language.
4. What is the output of console.log(2 + '2')?
5. What is the result of the expression: 5 > 3 && 2 > 7?
6. Which array method adds an element to the end of an array?
7. What does the acronym 'NaN' stand for in JavaScript?
8. Which loop is used to iterate over the properties of an object?
9. What is the output of typeof null?
10. Which function converts a string to an integer?
11. Which of the following are valid JavaScript variable names? (Select all that apply)
12. Which array methods modify the original array? (Select all that apply)
13. Which of the following are comparison operators in JavaScript? (Select all that apply)
14. Which of the following are ways to create a function in JavaScript? (Select all that apply)
15. The 'this' keyword in a global function refers to the window object in web browsers.
16. An empty array ([]) is considered falsy in JavaScript.
17. JavaScript code always executes line by line from top to bottom without exceptions.
18. What keyword is used to exit a loop early?
19. What is the output of console.log(typeof 'Hello World')?
20. What does the acronym JSON stand for?
Answered 0 of 0 — 0 correct