1. What does JS stand for?
Correct Answer: JavaScript
Explanation: JS stands for JavaScript, the programming language used in web development.
2. Which of the following is a way to declare a variable?
Correct Answer: All of the above
Explanation: In JavaScript, variables can be declared using var, let, or const.
3. How do you write a comment in JavaScript?
Correct Answer: // Comment
Explanation: Single-line comments in JavaScript start with "//".
4. How do you write "Hello World" in an alert box?
Correct Answer: alert("Hello World");
Explanation: The alert() function displays a message in a popup alert box.
5. Which symbol is used for strict equality comparison?
Correct Answer: ===
Explanation: "===" checks for both value and type equality in JavaScript.
6. Which method converts a JSON string into a JavaScript object?
Correct Answer: JSON.parse()
Explanation: JSON.parse() converts a JSON string into a JavaScript object.
7. How do you create a function in JavaScript?
Correct Answer: function myFunction() { }
Explanation: The function keyword is used to define a function in JavaScript.
8. How do you write an if statement in JavaScript?
Correct Answer: if (i == 5) { }
Explanation: The correct syntax for an if statement uses parentheses and curly braces.
9. Which operator is used to assign a value?
Correct Answer: =
Explanation: The single equals sign "=" is used to assign a value to a variable.
10. Which function is used to print something to the console?
Correct Answer: console.log()
Explanation: console.log() is used to output messages to the web console.