let numbers = [ 1, 2, 3 ]
let myFunction = (x, y, z) => {
return x + y + z;
}
// Returns 6
let getCalculation = myFunction(...numbers);
// When you have a function that takes in a number and you have these numbers as
// elements of an array, You can use the spread operator to pass these elements
// into the function call as arguments using the spread operator
let scores = [12, 33, 6]
const addAll = (a, b, c) => {
console.log(a + b + c);
};
addAll(...scores); // 51