Skip to content

Instantly share code, notes, and snippets.

@shobhitsharma
Created July 1, 2018 18:30
Show Gist options
  • Save shobhitsharma/070e3a913c35b94dbfd10d6dd6e2fb10 to your computer and use it in GitHub Desktop.
Save shobhitsharma/070e3a913c35b94dbfd10d6dd6e2fb10 to your computer and use it in GitHub Desktop.
Number to Binary in Javascript
function numberToBinary(num) {
return Math.abs(num).toString(2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment