To accept unlimited number of arguments in a JavaScript function, we do the following:
sum = (...numbers) => {
let total = 0;
for(const number of numbers){
total += number
}
return total;
}
console.log(sum(5,4,6,5,5,6,6,6,6,5,54,4,4,223,433,45564,4,44,4,8686,6,6886,6)) //61972
Generate Random Background Color
![codeflare](https://codeflarelimited.com/blog/wp-content/uploads/2024/03/download_image_1707459047312.png)