You are viewing a single comment's thread. Return to all comments →
JavaScript
// Preparing variables let [ hi, lo ] = [ scores[0], scores[0] ]; let [ max, min ] = [ 0, 0 ]; // Calculating for (let i = 1; i < scores.length; i++) { if (scores[i] > hi) { hi = scores[i]; max++; } if (scores[i] < lo) { lo = scores[i]; min++; } } //Returning return [ max, min ];
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
JavaScript