JavaScript Basics
This test evaluates your foundational knowledge of JavaScript including variables, data types, functions, loops, and conditionals. To learn more and build a strong foundation, check out free resources like the MDN JavaScript Guide, the interactive lessons at freeCodeCamp JavaScript Course, and this beginner-friendly JavaScript tutorial on YouTube.
1
Which keyword is used to declare a variable in JavaScript?
2
What is the output of: typeof 'Hello'?
3
Which symbol is used for comments in JavaScript?
4
How do you write a function in JavaScript?
5
Which operator is used to assign a value to a variable?
6
Which of the following is a correct if statement?
7
Which method adds an element to the end of an array?
8
What will `console.log(2 + '2')` output?
9
How do you declare a constant in JavaScript?
10
Which loop is guaranteed to run at least once?