Hello, I have to do this exercise:
Enter a list of student names by screen. Each time a new user is entered, ask if you want to enter another one using the "Confirm" function. In case the user does not want to enter another student, show the following results by console:
Indicate the number of students who were admitted
Ask if "Maradona" came to the class. Do it with another function that takes an array as a parameter and returns true or false depending on whether it was found
Show the list of students by screen.
But I do not know how to solve the part of if Maradona came to the class.
var ingresarAlumno = confirm("Bievenido. Desea ingresar un alumno?");
var contador = 0;
if (ingresarAlumno){
var alumno = prompt("Por favor ingrese el nombre de un alumnno");
if (alumno != ''){
contador = contador+1;
console.log(alumno);
}
while(confirm('ingresar otro?')){
var alumno = prompt("Por favor ingrese el nombre de un alumnno");
if (alumno != ''){
contador = contador+1;
console.log(alumno);
}
}
console.log(contador);
}