JavaScript · Junior · Question 58 of 75
What type does (1.005).toFixed(2) return?
- ✓Correct answer: A string
- 2A number
- 3A
BigInt
Explanation
toFixed returns a formatted string, so price.toFixed(2) + 1 concatenates. Also, due to binary floating point, (1.005).toFixed(2) is "1.00", not "1.01".