I am asking you to print only the name and notes. But it is doubling at the time of printing. That is ... If I typed John, 1,2,3,4; Pedro, 3,4,5,6. At the time of printing, it prints twice the same thing.
//criar sala de aula com 4 alunos que possuem 4 notas e depois calcular a média de cada aluno.
//Sem objeto
var sala = [];
var aluno = [];
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 5; j++) {
if (j == 0) {
aluno.push(prompt("Digite o nome"));
} else {
aluno.push(prompt("Digite a nota"));
}
}
sala.push(aluno);
}
console.info(sala.length);
for (var i = 0; i < sala.length; i++) {
for (var j = 0; j < sala[i].length; j++) {
if (j == 0) {
console.log(sala[i][j]);
} else {
//console.log(parseFloat(sala[i][j]));
console.log(sala[i][j]);
}
}
}