var rec = "Hello world is the best line ever.";
rec = rec.toLowerCase();
for(var i=0;i<rec.length;i++){
if(rec[i] === 'a' || rec[i] === 'e' || rec[i] === 'i' || rec[i] === 'o' || rec[i] === 'u'){
rec[i] = " ";
}
}
console.log(rec);
I learned that we can approach strings the same way we manipulate array in Javascript, at least in this case I believe this should work properly but for some reason I get the whole string in output. To emphasize, I just need string rec
without vowels, instead with (or without) space.