Generation

generate functionFri, 18 Nov 2022

add 3 numbers

function add(a,b,c){ return a + b + c; } add(1,2,3) // use the rest operator function add(...nums){ let total = 0; for (let num of nums){ total += num; } return total; } add(1,2,3,4,5,6)

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code