JavaScript MCQs with answers Page - 143

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

Q. Which of the following methods converts JSON data to a JavaScript object?

  • (A) JSON.parse()
  • (B) JSON.stringify()
  • (C) JSON.toObject()
  • (D) JSON.convert()

A

Admin • 833K Points
Coach

Q. What is the output of: console.log('5' + 3);

  • (A) 8
  • (B) 53
  • (C) NaN
  • (D) Error

A

Admin • 833K Points
Coach

Q. What will be the output of the following code?

Code:
console.log(2 + '2');
  • (A) 4
  • (B) 22
  • (C) NaN
  • (D) Error

A

Admin • 833K Points
Coach

Q. How do you define an arrow function in JavaScript?

  • (A) function => {}
  • (B) () => {}
  • (C) () =>
  • (D) => () {}

A

Admin • 833K Points
Coach

Q. What does '===' operator do in JavaScript?

  • (A) Assigns value
  • (B) Compares value and type
  • (C) Compares only value
  • (D) Checks if variable is defined

A

Admin • 833K Points
Coach

Q. Which built-in method reverses the elements of an array?

  • (A) flip()
  • (B) reverse()
  • (C) turn()
  • (D) back()

A

Admin • 833K Points
Coach

Q. What is the result of typeof NaN in JavaScript?

  • (A) number
  • (B) NaN
  • (C) undefined
  • (D) object

A

Admin • 833K Points
Coach

Q. Which of the following is not a JavaScript data type?

  • (A) Boolean
  • (B) Undefined
  • (C) Float
  • (D) Symbol

A

Admin • 833K Points
Coach

Q. What will the following code print?

Code:
let a;
console.log(a);
  • (A) null
  • (B) undefined
  • (C) 0
  • (D) ReferenceError

A

Admin • 833K Points
Coach

Q. Which function is used to parse a string to an integer?

  • (A) parseInt()
  • (B) int()
  • (C) toInteger()
  • (D) Number.parse()

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