You need to fill the array with the help of the command prompt in which there will be a list of 5 any names. Then print a prompt with the prompt asking for the username
The entered name, a cycle to compare with the names in the array. If the entered username does not exist in the array, give an error message to alert (). If there is a match - display the message "Andrew, you have successfully entered . "
Instead of "Andrew" should be the name of the current user.
I sketched the code, but it is incomplete and I can not understand the algorithm of actions.
var arr = []; for (var i = 0; i < arr.length; i++); var a = prompt("Enter your name"); if (a == arr) { alert( a + " вы успешно вошли! "); } else{ alert("Ошибка") }