From ae425f03ed47e0da401e5a608e6a239998d70d64 Mon Sep 17 00:00:00 2001 From: Harrison Shoff Date: Wed, 7 Aug 2013 13:04:47 -0700 Subject: [PATCH] [type casting] move explanation about bitshift closer to example code. fixes #80 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 84dff9a56d..609fcb910d 100644 --- a/README.md +++ b/README.md @@ -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 /**