Clarify proper type casting for Numbers

Clarifies when to use `Number` vs. `parseInt` for Number type casting.

Fixes: #523
This commit is contained in:
Danny Nemer
2015-09-25 09:59:08 -04:00
committed by Danny Nemer
parent 58c901c330
commit 7d0e236b59

View File

@@ -1640,7 +1640,7 @@ Other Style Guides
const totalScore = String(this.reviewScore);
```
- [21.3](#21.3) <a name='21.3'></a> Use `parseInt` for Numbers and always with a radix for type casting.
- [21.3](#21.3) <a name='21.3'></a> Numbers: Use `Number` for type casting and `parseInt` always with a radix for parsing strings.
```javascript
const inputValue = '4';