JavaScript MCQs with answers Page - 2

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

Q. A hexadecimal literal begins with

  • (A) 00
  • (B) 0x
  • (C) 0X
  • (D) Both 0x and 0X

A

Admin • 831.35K Points
Coach

Q. The generalised syntax for a real number representation is

  • (A) [digits][.digits][(E|e)[(+|-)]digits]
  • (B) [digits][+digits][(E|e)[(+|-)]digits]
  • (C) [digits][(E|e)[(+|-)]digits]
  • (D) [.digits][digits][(E|e)[(+|-)]digits]

A

Admin • 831.35K Points
Coach

Q. When there is an indefinite or an infinity value during an arithmetic value computation, javascript

  • (A) Prints an exception error
  • (B) Prints an overflow error
  • (C) Displays “Infinity”
  • (D) Prints the value as such

A

Admin • 831.35K Points
Coach

Q. The enumeration order becomes implementation dependent and non-interoperable if:

  • (A) The delete keyword is never used
  • (B) Object.defineProperty() is not used
  • (C) If the object inherits enumerable properties
  • (D) The object does not have the properties present in the integer array indices

A

Admin • 831.35K Points
Coach

Q. The “var” and “function” are __________.

  • (A) Prototypes
  • (B) Data types
  • (C) Keywords
  • (D) Declaration statements

A

Admin • 831.35K Points
Coach

Q. When an empty statement is encountered, a JavaScript interpreter

  • (A) Throws an error
  • (B) Shows a warning
  • (C) Ignores the statement
  • (D) Prompts to complete the statement

A

Admin • 831.35K Points
Coach

Q. What is block statement in JavaScript?

  • (A) block that combines multiple statements into a single compound statement
  • (B) both conditional block and single statement
  • (C) block that contains a single statement
  • (D) conditional block

A

Admin • 831.35K Points
Coach

Q. A conditional expression is also called a

  • (A) If-then-else statement
  • (B) Alternative to if-else
  • (C) Immediate if
  • (D) All of above

A

Admin • 831.35K Points
Coach

Q. JavaScript is a _______________ language

  • (A) Object-Based
  • (B) Assembly-language
  • (C) High-level
  • (D) Object-Oriented

A

Admin • 831.35K Points
Coach

Q. Assume that we have to convert “false” that is a non-string to string. The command that we use is (without invoking the “new” operator)

  • (A) String newvariable=”false”
  • (B) Both false.toString() and String(false)
  • (C) String(false)
  • (D) false.toString()

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