kindly look at the code and tell whats wrong in it, its simply showing nothing, a blank screen.
let input = "turpentine and turtles";
let vowels = ["a", "e", "i", "o", "u"];
let resultArray = [];
for (let i = 0; i < input.length; i++) {
if (input[i] === "e") {
resultArray.push(input[i]);
}
if (input[i] === "u") {
resultArray.push(input[i]);
}
for (let j = 0; j < vowels.length; j++) {
if (input[i] === vowels[j]) {
resultArray.push(input[i]);
}
}
}
const resultString = resultArray.join("").toUpperCase();
console.log(resultString);
You are joining your array before ever adding anything to it
1 Like
O what a silly mistake lol, Thankyou so much, been an hour trynna find the problem lol