You are viewing a single comment's thread. Return to all comments →
Using javaScript: let max = scores[0]; let min = scores[0];
let maxBreak = scores.reduce((result, curr) => { if(max < curr){ result += 1; max = curr; } return result; }, 0); let minBreak = scores.reduce((result, curr) => { if(min > curr){ result += 1; min = curr; } return result; }, 0); return [maxBreak, minBreak];
}
console.log(breakingRecords([12, 24, 10, 24]))
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 →
Using javaScript: let max = scores[0]; let min = scores[0];
}
console.log(breakingRecords([12, 24, 10, 24]))