Tell us what’s happening:
I connot solve this task,help me please?Preformatted text
Your code so far
const sum = (x, y, z) => {
const args = [x, y, z];
return args.reduce((a, b) => a + b, 0);
}
console.log(sum(1, 2, 3)); // 6
console.log(sum(1, 2, 3, 4)); // 6
The result of sum(0,1,2) should be 3
The result of sum(1,2,3,4) should be 10
The result of sum(5) should be 5
The result of sum() should be 0
The sum function should use the ... rest parameter on the args parameter.