Skip to content

Instantly share code, notes, and snippets.

@Nasah-Kuma
Created September 29, 2022 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nasah-Kuma/5e79d960716a88237e8b00dbafb32320 to your computer and use it in GitHub Desktop.
Save Nasah-Kuma/5e79d960716a88237e8b00dbafb32320 to your computer and use it in GitHub Desktop.
function birthdayCakeCandles(candles) {
const max = Math.max(...candles);
let counter = 0;
for(let candle of candles) {
if (candle === max) counter++;
}
return counter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment