JavaScript MCQs with answers Page - 149

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. What is hoisting in JavaScript?

  • (A) Declaring variables at the top
  • (B) Using let and const only
  • (C) JavaScript's default behavior of moving declarations to the top
  • (D) None of the above

A

Admin • 833K Points
Coach

Q. Which value is returned when a function doesn't explicitly return anything?

  • (A) null
  • (B) undefined
  • (C) false
  • (D) 0

A

Admin • 833K Points
Coach

Q. How can you clone an object in JavaScript?

  • (A) Object.clone(obj)
  • (B) obj.copy()
  • (C) Object.assign({}, obj)
  • (D) clone(obj)

A

Admin • 833K Points
Coach

Q. What does the 'await' keyword do?

  • (A) Pauses the function until a promise settles
  • (B) Pauses script execution globally
  • (C) Rejects promises
  • (D) Creates a new thread

A

Admin • 833K Points
Coach

Q. What is the output?

Code:
console.log(3 > 2 > 1);
  • (A) true
  • (B) false
  • (C) undefined
  • (D) NaN

A

Admin • 833K Points
Coach

Q. What type is returned by Array.isArray([])?

  • (A) boolean
  • (B) string
  • (C) object
  • (D) undefined

A

Admin • 833K Points
Coach

Q. Which method returns the first index of an element?

  • (A) search()
  • (B) findIndex()
  • (C) indexOf()
  • (D) find()

A

Admin • 833K Points
Coach

Q. Which of the following is true about 'const'?

  • (A) Cannot be reassigned
  • (B) Cannot be mutated
  • (C) Not block-scoped
  • (D) Hoisted to top with undefined

A

Admin • 833K Points
Coach

Q. What will this return?

Code:
console.log('10' - '4' - '3' - 2 + '5');
  • (A) 15
  • (B) 1
  • (C) 15
  • (D) 15undefined

A

Admin • 833K Points
Coach

Q. Which statement is true about let, var, and const?

  • (A) var is block scoped
  • (B) let is function scoped
  • (C) const must be initialized
  • (D) const can be reassigned

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