mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-07 00:00:53 -05:00
fix(curriculum): update JS fundamentals quiz Number object question (#66216)
This commit is contained in:
committed by
GitHub
parent
cb65db51e7
commit
8a4c565bf7
@@ -118,23 +118,23 @@ console.log(stringArray);
|
||||
|
||||
#### --text--
|
||||
|
||||
How can you convert a string literal into a Number object?
|
||||
Which of the following returns a `Number` object from the string `"123"`?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
With the `Object()` constructor.
|
||||
`Object("123")`
|
||||
|
||||
---
|
||||
|
||||
With the `.toNumber()` method.
|
||||
`"123".toNumber()`
|
||||
|
||||
---
|
||||
|
||||
With the `.parseInt()` method.
|
||||
`Number("123")`
|
||||
|
||||
#### --answer--
|
||||
|
||||
With the `Number()` constructor.
|
||||
`new Number("123")`
|
||||
|
||||
### --question--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user