[type casting] move explanation about bitshift closer to example code. fixes #80

This commit is contained in:
Harrison Shoff
2013-08-07 13:04:47 -07:00
parent 17c8be1117
commit ae425f03ed

View File

@@ -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';
@@ -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.
// good
/**