Created
August 3, 2018 18:59
-
-
Save orenfromberg/411c9fa0b356643513d9490f752d06f3 to your computer and use it in GitHub Desktop.
friday coding challenge one liner
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
const bin = (number) => Array(64).fill(1).map((val,i) => (2 ** (64 - i - 1)) & number ? 1 : 0).join('').replace(/^0+/g,'') | |
console.log(bin(14)) | |
console.log(bin(15)) | |
console.log(bin(52359823756)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment