Answers for "spread an object in named args"

7

the rest operator javascript

function sum(...numbers) {
	return numbers.reduce((accumulator, current) => {
		return accumulator += current;
	});
};
 
sum(1,2) // 3
sum(1,2,3,4,5) // 15
Posted by: Guest on January-14-2020
0

javascript spread operator

function myFunction(v, w, x, y, z) { }
let args = [0, 1];
myFunction(-1, ...args, 2, ...[3]);
Posted by: Guest on November-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language