0% found this document useful (0 votes)
6 views2 pages

JavaScript MCQ Questions

This document contains multiple-choice questions (MCQs) related to JavaScript, covering topics such as data types, syntax for console output, comments, variable declaration, JSON conversion, and the Document Object Model (DOM). Each question is followed by four answer options, with the correct answer indicated. The questions test fundamental knowledge of JavaScript programming concepts.

Uploaded by

omnimbalkar757
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

JavaScript MCQ Questions

This document contains multiple-choice questions (MCQs) related to JavaScript, covering topics such as data types, syntax for console output, comments, variable declaration, JSON conversion, and the Document Object Model (DOM). Each question is followed by four answer options, with the correct answer indicated. The questions test fundamental knowledge of JavaScript programming concepts.

Uploaded by

omnimbalkar757
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript MCQ Questions with Answers

1. Which of the following is a JavaScript data type?

A. Float
B. String
C. Decimal
D. Double
Answer: B

2. What is the correct syntax to print a message in the console in JavaScript?

A. print("Hello")
B. console.log("Hello")
C. log.console("Hello")
D. printf("Hello") Answer: B

3. Which symbol is used for single-line comments in JavaScript?

A. <!-- -->
B. #
C. //
D. **
Answer: C

4. How do you declare a variable in JavaScript?

A. v x = 10
B. dim x = 10
C. var x = 10
D. int x = 10
Answer: C

5. What is the output of: typeof [] ?

A. Object
B. Array
C. List
D. Undefined
Answer: A

6. Which method is used to convert JSON data to a JavaScript object?

A. JSON.stringify()
B. JSON.parse()
C. parse.JSON()
D. JSON.convert() Answer: B

7. Which company developed JavaScript?

A. Microsoft
B. Mozilla
C. Sun Microsystems
D. Netscape Answer: D

8. What does DOM stand for in JavaScript?

A. Data Object Model


B. Document Object Model
C. Dynamic Object Management
D. Digital Object Model
Answer: B

9. Which function is used to delay execution in JavaScript?

A. wait()
B. setTimeout()
C. pause()
D. sleep() Answer: B

10. Which operator is used to compare both value and type in JavaScript?

A. ==
B. =
C. ===
D. !=
Answer: C

You might also like