I Want My Array To Run But I cannot find out why it doesn't


#1

function someName('Clarissa'){
var vowel = ["a","e","i","o","u"];
for (var i=0; i if (str[i] === "a" ||
str[i] === "e" ||
str[i] === "i" ||
str[i] === "o" ||
str[i] === "u") ||{
console.log (someName[i],);}
}


#2

You cannot run an if statement inside a for loop, I would do it like this:

function someName('Clarissa'){
var vowel = ["a","e","i","o","u"];
for (var i=0; i <= someName.length; i++) { 
if (str[i] === "a" ||
str[i] === "e" ||
str[i] === "i" ||
str[i] === "o" ||
str[i] === "u") {
console.log (someName[i],);}
}