After completing the first part of JavaScript quiz questions, let’s move to the second JavaScript quiz. We have covered very interesting JavaScript quiz questions for beginners and advanced learners. This JavaScript MCQ quiz will help you to test your knowledge of JavaScript language.

Q.1 Predict the result. undefined 4 5 NaN Correct! Wrong! Q.2 Determine the result - String("Hello") === "Hello"; true false SyntaxError ReferenceError Correct! Wrong! Q.3 What is the correct JavaScript syntax to print “DataFlair” in the console? print(“DataFlair”); console.print(“DataFlair”); log.console(“DataFlair”); console.log(“DataFlair”); Correct! Wrong! Q.4 Which of the following print content on the browser window? document.write(“print content”); response.write(“print content”); document.write(print content); write(“print content”); Correct! Wrong! Q.5 Which method will you use to round the number 24.76 to the nearest integer? round(24.76); rnd(24.76); Math.round(24.76); Math.rnd(24.76); Correct! Wrong! Q.6 Which of the following statements will show a message as well as ask for user input in a popup? alert() prompt() confirm() message() Correct! Wrong! Q.7 Which of the following is an event listener in JavaScript? onclick blur click Click() Correct! Wrong! Q.8 You are a web designer in your company and need to create a JavaScript project for form validation. What are the advantages that JavaScript provides for forms? Bandwidth conservation Form validation Increased user satisfaction All of the above Correct! Wrong! Q.9 What is the syntax of a "for" statement in JavaScript? for(increment; condition; initialization) for(initialization, condition, increment) for(condition; initialization; increment) for(initialization; condition; increment) Correct! Wrong! Q.10 Which of the given options is an incorrect variable name? javascript _javascript $javascript -javascript Correct! Wrong!

This was all in the DataFlair’s JavaScript Quiz Questions Part – 2. I hope you scored well in this JavaScript online quiz. If you feel confusion in any JavaScript concept, revise them from JavaScript Tutorial Series.