Defining variables (#35891)

biString, uniString and i should be defined.
pull/35893/head
Cezary Waś 2019-04-22 07:55:30 +02:00 committed by The Coding Aviator
parent 7b51ec6487
commit 65a92f7ef9
1 changed files with 3 additions and 3 deletions

View File

@ -41,13 +41,13 @@ Make sure that each time you transcode a character from binary to decimal, you r
## ![:beginner:](https://forum.freecodecamp.com/images/emoji/emoji_one/beginner.png?v=3 ":beginner:") Basic Code Solution:
```javascript
function binaryAgent(str) {
biString = str.split(' ');
uniString = [];
var biString = str.split(' ');
var uniString = [];
/*using the radix (or base) parameter in parseInt, we can convert the binary
number to a decimal number while simultaneously converting to a char*/
for(i=0;i < biString.length;i++){
for(var i=0;i < biString.length;i++){
uniString.push(String.fromCharCode(parseInt(biString[i], 2)));
}