Problemas
Which of the following programs will result in filteredNames only containing the names of students who are A. for(var 1-9;1 < ages,length; 149)( age - ages[1]; if(age < 17) appenditen(filteredianes, age) ) B. for(var 1 + 9; 1 < ages.length; 100)( age ages[1]; if(age < 17) appenditen(filteredisames names(i]) C.
Roztwór
Oscar
maestro · Tutor durante 5 años
3.5
(285 Votos)
Respuesta
The correct answer is option C.In option C, the program uses a for loop to iterate through the ages array. For each age, it checks if the age is less than 17. If the age is less than 17, it appends the name of the student to the filteredNames array. This ensures that only the names of students who are less than 17 years old are included in the filteredNames array.