Skip to main content

Fundamentals of Front End Development MCQs with Answers

Practice important Fundamentals of Front End Development MCQs with answers and explanations.

Chapter: 62
Q721:
What is the maximum number of decimals JavaScript can accurately handle?
A. 15
B. 17
C. 20
D. 30
Correct Answer: B
Chapter: 62
Q722:
Fill in the blank: 0.2 + 0.1 results in ________ due to floating point precision.
A. 0.3
B. 0.3
C. 0.3
D. 0.31
Correct Answer: B
Chapter: 62
Q723:
How can you create a number object in JavaScript?
A. var x = 123;
B. var x = new Number(123);
C. var x = Number(123);
D. var x = new Integer(123);
Correct Answer: B
Chapter: 62
Q724:
Fill in the blank: x === y will be false if x is a primitive number and y is ________.
A. another primitive number
B. a string
C. a number object
D. undefined
Correct Answer: C
Chapter: 62
Q725:
Fill in the blank: In JavaScript, the new Number(500) and 500 are treated as ________.
A. equal in type and value
B. equal in value but different in type
C. not equal
D. identical objects
Correct Answer: B
Chapter: 63
Q726:
Which method returns a number as a string in JavaScript?
A. toFixed()
B. toString()
C. toPrecision()
D. valueOf()
Correct Answer: B
Chapter: 63
Q727:
Fill in the blank: The method toExponential() returns a string with a number rounded and written with ________.
A. a specific number of decimals
B. a specified length
C. scientific notation
D. a fixed length
Correct Answer: C
Chapter: 63
Q728:
What does the valueOf() method return?
A. A string
B. A boolean
C. A number as a number
D. An object
Correct Answer: C
Chapter: 63
Q729:
Fill in the blank: The parseInt("10.33") returns ________.
A. 10
B. 10.33
C. NaN
D. 33
Correct Answer: A
Chapter: 63
Q730:
Which method parses a string and returns a whole number, ignoring any subsequent characters?
A. parseFloat()
B. parseInt()
C. Number()
D. toString()
Correct Answer: B
Chapter: 63
Q731:
Fill in the blank: The parseFloat("10 years") returns ________.
A. 10
B. 10.33
C. NaN
D. 10 years
Correct Answer: A
Chapter: 63
Q732:
Fill in the blank: The parseInt("10 20 30") function returns ________.
A. 10
B. 20
C. 30
D. NaN
Correct Answer: A
Chapter: 63
Q733:
Which method can convert a date to a numeric value in JavaScript?
A. parseInt()
B. toString()
C. Number()
D. toFixed()
Correct Answer: C
Chapter: 63
Q734:
Fill in the blank: parseInt("10 years") returns ________ because the string contains non-numeric characters.
A. NaN
B. 10
C. 10 years
D. 20
Correct Answer: A
Chapter: 63
Q735:
What does the toString() method do to a number?
A. Converts it to a string
B. Rounds it to a specified number of decimals
C. Returns it in scientific notation
D. Returns it with a specified length
Correct Answer: A
Chapter: 64
Q736:
What does the Math.random() method return?
A. A random number between 0 and 1
B. A random number between 1 and 100
C. The lowest number from a list
D. The highest number from a list
Correct Answer: A
Chapter: 64
Q737:
Fill in the blank: Math.round(4.7) returns ________.
A. 4
B. 5
C. 4.7
D. 6
Correct Answer: B
Chapter: 64
Q738:
Which method rounds a number down to the nearest integer?
A. Math.round()
B. Math.ceil()
C. Math.floor()
D. Math.min()
Correct Answer: C
Chapter: 64
Q739:
Fill in the blank: Math.floor(4.7) returns ________.
A. 4
B. 5
C. 4.7
D. 6
Correct Answer: A
Chapter: 64
Q740:
Which constant returns the value of PI in JavaScript?
A. Math.E
B. Math.PI
C. Math.LN2
D. Math.SQRT2
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Fundamentals of Front End Development

🚀 Start Quiz Now