Created
March 25, 2016 11:27
-
-
Save Colorfulstan/a0c88c696f074154b2d2 to your computer and use it in GitHub Desktop.
strange javascript operators from npm repeat-string >>= and &
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//while (max > res.length && num > 0) { | |
if (num & 1) { // 1 if num is odd | |
// res += str; | |
} | |
num >>= 1; // halfs num to an integer (rounded down) | |
// if (!num) break; | |
// str += str; | |
//{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment