This code creates a function that will create a set of candles that is the same size as the number of arguments passed in.
function birthdayCakeCandles(candles) {
var max_candles = Math.max(...candles)
var number_candles = 0
for(var i=0; i<candles.length; i++){
if(candles[i] == max_candles){
number_candles = number_candles + 1
}
}
return number_candles;
}