You are viewing a single comment's thread. Return to all comments →
solucion:
const scoreHigh =[];
const scorelow = [];
let comparador = scores[0]; let comparadorlow = scores[0];
for (let index = 1; index < scores.length; index++) { const element = scores[index];
if ( element > comparador) { scoreHigh.push(element); comparador = element; } else if (element < comparadorlow ) { scorelow.push(element); comparadorlow = element; }
};
return [scoreHigh.length, scorelow.length]
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
solucion:
const scoreHigh =[];
const scorelow = [];
let comparador = scores[0]; let comparadorlow = scores[0];
for (let index = 1; index < scores.length; index++) { const element = scores[index];
};
return [scoreHigh.length, scorelow.length]