Skip to content

Instantly share code, notes, and snippets.

@Nasah-Kuma
Created September 19, 2022 12:44
Embed
What would you like to do?
function breakingRecords(scores) {
// Write your code here
let [min, max] = [0, 0];
let minScore = scores[0];
let maxScore = scores[0];
for(let i = 1; i < scores.length; i++) {
if (scores[i] < minScore) {
min++;
minScore = scores[i];
} else if(scores[i] > maxScore) {
max++;
maxScore = scores[i];
}
}
return[max, min];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment