Skip to content

Commit

Permalink
Clarify proper type casting for Numbers
Browse files Browse the repository at this point in the history
Clarifies when to use `Number` vs. `parseInt` for Number type casting.

Fixes: airbnb#523
  • Loading branch information
DannyNemer authored and jaylaw81 committed Sep 19, 2017
1 parent 07ad946 commit cd5edef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit cd5edef

Please sign in to comment.