What would be the output of the following code? (Based on Spread Operator)

@Devtools Tech
function sum(x, y, z) {
  return x + y + z;
}

const numbers = [1, 2, 3];

console.log(sum(...numbers));
Option 1
undefined
Option 2
NaN
Option 3
6
Option 4
'123'
Do you see value in our efforts?

Devtools Tech is a free platform for Frontend Engineers. It takes a lot of time, effort, and finanical resources to keep the platform running. If you see any value in our work and would like to support us then you can do using the following options.

InternationalDomestic