Podcast
Questions and Answers
What method in JavaScript rounds a number to a given precision?
What method in JavaScript rounds a number to a given precision?
- toFixed(n) (correct)
- roundPrecision(n)
- precisionRound(n)
- numberRound(n)
Which constructor in JavaScript is considered highly unrecommended for creating wrapper objects?
Which constructor in JavaScript is considered highly unrecommended for creating wrapper objects?
- new String()
- new Boolean()
- new Object()
- new Number() (correct)
What is the output from the alert( typeof new Number(0) ) statement in JavaScript?
What is the output from the alert( typeof new Number(0) ) statement in JavaScript?
- "string"
- "boolean"
- "number"
- "object" (correct)
Why does the alert( 'zero is truthy!?!' ) statement get executed in the given code snippet?
Why does the alert( 'zero is truthy!?!' ) statement get executed in the given code snippet?
Which function in JavaScript converts a string into a number?
Which function in JavaScript converts a string into a number?
What is a key distinction between primitives and objects in JavaScript?
What is a key distinction between primitives and objects in JavaScript?
Which of the following is NOT a primitive type with its corresponding object wrapper?
Which of the following is NOT a primitive type with its corresponding object wrapper?
What is a benefit of using objects in JavaScript?
What is a benefit of using objects in JavaScript?
Why does the creator of JavaScript use 'object wrappers' for primitives like String, Number, Boolean, Symbol, and BigInt?
Why does the creator of JavaScript use 'object wrappers' for primitives like String, Number, Boolean, Symbol, and BigInt?
How does the JavaScript engine handle primitives when providing methods like str.toUpperCase()?
How does the JavaScript engine handle primitives when providing methods like str.toUpperCase()?