nassem1
9/14/2019 - 1:42 PM

rest parameters with Spread opreator

// rest parametar with spread method

function getAges6(...age) {
  const total = age.reduce((n, c) => {
    return (n += c);
  });
  console.log(total);
}
getAges6(12, 34, 54, 32, 23);
// result :- 155