Created
November 13, 2019 05:22
-
-
Save khalid32/16736e8576fc1f479bd4f4b2160ffa31 to your computer and use it in GitHub Desktop.
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
// === Binary to Decimal Conversion Example === | |
var binary = "10"; | |
var digit = parseInt(binary, 2); | |
console.log(' digit --> ',digit); | |
// === Decimal to Binary Conversion Example === | |
var str = "2"; | |
var bin = (+str).toString(2); | |
console.log(bin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment