Create an array and fill it with at least six usernames (i.e. “Sophia”, “Gabriel”, …) then loop through them with a for loop. If a username contains the letter “i” then alert the username.
I have tried to make an array and create and "if" statement, then I want to make an alert. I know I am missing something, but I can't figure out what.
let userNames = ['rachel', 'greg', 'mike', 'adam', 'susan', 'john'];
if(userNames.includes('i')){
window.alert(userNames);
}
I would like there to be a window alert with the name "mike"