Created
July 8, 2019 13:35
-
-
Save valex/c77343fca72a0822dc3024291e864b5a to your computer and use it in GitHub Desktop.
Упр №3, стр 109
This file contains hidden or 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
var input = "javascript is awesome"; | |
var output = ""; | |
for(var i=0; i < input.length; i++){ | |
if(input[i] === "a"){ | |
output += "4"; | |
}else if(input[i] === "e"){ | |
output += "3"; | |
} | |
else if(input[i] === "i"){ | |
output += "1"; | |
} | |
else if(input[i] === "o"){ | |
output += "0"; | |
} | |
else{ | |
output += input[i]; // output = output + input[i]; | |
} | |
} | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment