JavaScript MCQs with answers Page - 154

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 • 802.91K Points
Coach

Q. What is the output of this code?

Code:
let a = [1, 2, 3];
console.log(typeof a);
  • (A) array
  • (B) object
  • (C) list
  • (D) undefined

A

Admin • 802.91K Points
Coach

Q. What will be logged to the console?

Code:
console.log(0 == false);
  • (A) true
  • (B) false
  • (C) undefined
  • (D) TypeError

A

Admin • 802.91K Points
Coach

Q. Which method can be used to convert a string to an integer?

Code:
let value = '42';
let result = parseInt(value);
  • (A) Number.parse()
  • (B) parseString()
  • (C) parseInt()
  • (D) toInteger()