JavaScript MCQs with answers Page - 18

Here, you will find a collection of MCQ questions on JavaScript. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 832.27K Points
Coach

Q. Which of the following is the correct statement of WHILE loop start?

  • (A) while (i <= 10)
  • (B) while (i <= 10; i++)
  • (C) while i = 1 to 10
  • (D) None of These

A

Admin • 832.27K Points
Coach

Q. What was the original name of JavaScript when it discovered?

  • (A) LiveScript
  • (B) EScript
  • (C) JScript
  • (D) Mocha

A

Admin • 832.27K Points
Coach

Q. Which of the following is the correct way to write a comment in JavaScript code?

  • (A) //This is a comment
  • (B) /*This is a comment*/
  • (C) $This is a comment$
  • (D) **This is a comment**

A

Admin • 832.27K Points
Coach

Q. What would be the output of the following Javascript code?

Code:
var string1 = "Fee";  
var intvalue = 10000;  
alert( string1 + intvalue );
  • (A) Fee 10000
  • (B) 10000
  • (C) Fee10000
  • (D) Exception

A

Admin • 832.27K Points
Coach

Q. Which of the following JavaScript operator is used to assign a value to a variable based on some condition?

  • (A) Assignment operator
  • (B) Bitwise Operator
  • (C) Conditional operator
  • (D) Logical Operator

A

Admin • 832.27K Points
Coach

Q. Which of the following variables are used in JavaScript programs?

  • (A) Varying randomly
  • (B) Causing high-school algebra flashbacks
  • (C) Storing numbers, dates, or other values
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. What are the three crucial manipulations done in a "for loop" on a loop variable in JavaScript?

  • (A) The initialization, the Increment, and update
  • (B) The initialization, the test, and the update
  • (C) The initialization, the test, and Increment
  • (D) All of the above

A

Admin • 832.27K Points
Coach

Q. What are the different alternatives of == and != in JavaScript?

  • (A) It uses bitwise checking
  • (B) It uses === and !== instead
  • (C) It uses equals() and notequals() instead
  • (D) It uses equalto()

A

Admin • 832.27K Points
Coach

Q. Which of the following is a server-side JavaScript object?

  • (A) Date
  • (B) FileUpload
  • (C) File
  • (D) Function

A

Admin • 832.27K Points
Coach

Q. What are the different types of errors in JavaScript?

  • (A) Load time errors
  • (B) Run time errors
  • (C) Logical Errors
  • (D) All of the above

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ