Certified JavaScript Developer – Practice Exam
Verified Questions, Correct Answers, and Detailed
Explanations for Computer Science Students||Already
Graded A+
1. Which of the following is NOT a JavaScript data type?
A. Number
B. String
C. Boolean
D. Character
Answer: D
JavaScript does not have a separate char type; characters are strings
of length 1.
2. What is the output of typeof NaN?
A. "undefined"
B. "number"
C. "NaN"
D. "object"
Answer: B
NaN is considered a numeric value in JavaScript, so typeof NaN
returns "number".
3. Which method converts a JSON string into a JavaScript object?
A. JSON.toObject()
B. JSON.stringify()
C. JSON.parse()
D. JSON.convert()
,Answer: C
JSON.parse() converts JSON text into a JavaScript object.
4. Which statement correctly creates a JavaScript class?
A. class Car {}
B. Car class {}
C. new class Car {}
D. function class Car {}
Answer: A
The class keyword is used in ES6 to define classes.
5. What is the result of "5" - 2?
A. "3"
B. 3
C. "52"
D. NaN
Answer: B
The minus operator forces numeric coercion, so "5" becomes 5.
6. Which of the following is a falsy value?
A. "0"
B. []
C. {}
D. 0
Answer: D
Only numeric zero is falsy; "0", empty arrays, and empty objects are
truthy.
, 7. What does Array.isArray() return?
A. True only for arrays
B. True for objects
C. True for array-like objects
D. True for NodeLists
Answer: A
Array.isArray() returns true strictly for array objects.
8. Which function is used to schedule a callback after a delay?
A. setImmediate()
B. wait()
C. setTimeout()
D. delay()
Answer: C
setTimeout() schedules a function to run after a specified delay.
9. The let keyword provides what scope?
A. Global
B. Function
C. Block
D. Script
Answer: C
Variables declared with let are block scoped.
10. What is closure in JavaScript?
A. A function inside an array
B. A function returning another function
Verified Questions, Correct Answers, and Detailed
Explanations for Computer Science Students||Already
Graded A+
1. Which of the following is NOT a JavaScript data type?
A. Number
B. String
C. Boolean
D. Character
Answer: D
JavaScript does not have a separate char type; characters are strings
of length 1.
2. What is the output of typeof NaN?
A. "undefined"
B. "number"
C. "NaN"
D. "object"
Answer: B
NaN is considered a numeric value in JavaScript, so typeof NaN
returns "number".
3. Which method converts a JSON string into a JavaScript object?
A. JSON.toObject()
B. JSON.stringify()
C. JSON.parse()
D. JSON.convert()
,Answer: C
JSON.parse() converts JSON text into a JavaScript object.
4. Which statement correctly creates a JavaScript class?
A. class Car {}
B. Car class {}
C. new class Car {}
D. function class Car {}
Answer: A
The class keyword is used in ES6 to define classes.
5. What is the result of "5" - 2?
A. "3"
B. 3
C. "52"
D. NaN
Answer: B
The minus operator forces numeric coercion, so "5" becomes 5.
6. Which of the following is a falsy value?
A. "0"
B. []
C. {}
D. 0
Answer: D
Only numeric zero is falsy; "0", empty arrays, and empty objects are
truthy.
, 7. What does Array.isArray() return?
A. True only for arrays
B. True for objects
C. True for array-like objects
D. True for NodeLists
Answer: A
Array.isArray() returns true strictly for array objects.
8. Which function is used to schedule a callback after a delay?
A. setImmediate()
B. wait()
C. setTimeout()
D. delay()
Answer: C
setTimeout() schedules a function to run after a specified delay.
9. The let keyword provides what scope?
A. Global
B. Function
C. Block
D. Script
Answer: C
Variables declared with let are block scoped.
10. What is closure in JavaScript?
A. A function inside an array
B. A function returning another function