I have this code here, when I debug it, it prints out the characters on multiple lines but I want them to be on the same line in order to recompose the word inputted. For example, when I debug it inputting the word hello it prints out:
h
i
l
l
i
how ever I would like to print this: hilli. Any idea?? Thanks.
var say = prompt("name");
for ( var count = 0; count <= say.length; count++){
var letter = say.charAt(count);
if (letter == "a" || letter == "e" || letter == "o" || letter == "u"){
letter = "i";
}
console.log(letter);
}
console.log()just once.RegExpor regular string replacement to work out the occurrences and print the result. You don't need anyloophere.