Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0e398bb + b9c6491 commit e757a00Copy full SHA for e757a00
Conversions/BinaryToDecimal.js
@@ -1,6 +1,6 @@
1
function binaryToDeicmal (binaryNumber) {
2
let decimalNumber = 0
3
- const binaryDigits = binaryNumber.split('').reverse() // Splits the bnary number in revered single digits
+ const binaryDigits = binaryNumber.split('').reverse() // Splits the binary number into reversed single digits
4
binaryDigits.forEach((binaryDigit, index) => {
5
decimalNumber += binaryDigit * (Math.pow(2, index)) // Summation of all the decimal converted digits
6
})
0 commit comments