JavaScript Quiz

JavaScript Quiz

1: What is the correct way to declare a variable in JavaScript?




2: What is the result of the expression "2" + 2 in JavaScript?




3: How do you write a comment in JavaScript?




4: Which function is used to parse a string to an integer in JavaScript?




5: What is the purpose of the JavaScript function "addEventListener"?




6: What does the JavaScript method "charAt()" return?




7: What is the purpose of the JavaScript "splice()" method?




8: What is the purpose of the "typeof" operator in JavaScript?




9: What is the purpose of the JavaScript "map()" method for arrays?




10: In JavaScript, what is the purpose of the "JSON.stringify()" method?