Answers for "mdn Rest"

0

mdn Rest

function sum(...theArgs) {
  return theArgs.reduce((previous, current) => {
    return previous + current;
  });
}

console.log(sum(1, 2, 3));
// expected output: 6
Posted by: Guest on October-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language