Skip to content

Commit ae425f0

Browse files
committed
[type casting] move explanation about bitshift closer to example code. fixes airbnb#80
1 parent 17c8be1 commit ae425f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,6 @@
914914
```
915915
916916
- Use `parseInt` for Numbers and always with a radix for type casting.
917-
- 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.
918917
919918
```javascript
920919
var inputValue = '4';
@@ -936,6 +935,9 @@
936935
937936
// good
938937
var val = parseInt(inputValue, 10);
938+
```
939+
940+
- 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.
939941

940942
// good
941943
/**

0 commit comments

Comments
 (0)