Skip to content

Commit

Permalink
[type casting] move explanation about bitshift closer to example code.
Browse files Browse the repository at this point in the history
…fixes #80
  • Loading branch information
hshoff committed Aug 7, 2013
1 parent 17c8be1 commit ae425f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,6 @@
```
- Use `parseInt` for Numbers and always with a radix for type casting.
- If for whatever reason you are doing something wild and `parseInt` is your bottleneck and need to use Bitshift for [performance reasons](http://jsperf.com/coercion-vs-casting/3), leave a comment explaining why and what you're doing.
```javascript
var inputValue = '4';
Expand All @@ -936,6 +935,9 @@
// good
var val = parseInt(inputValue, 10);
```
- If for whatever reason you are doing something wild and `parseInt` is your bottleneck and need to use Bitshift for [performance reasons](http://jsperf.com/coercion-vs-casting/3), leave a comment explaining why and what you're doing.

This comment has been minimized.

Copy link
@wildlyinaccurate

wildlyinaccurate Aug 8, 2013

Missing a "```javascript" here, I think

This comment has been minimized.

Copy link
@hshoff

hshoff Aug 8, 2013

Author Member

Fixed. Thanks! 🍻

// good
/**
Expand Down

0 comments on commit ae425f0

Please # to comment.