JSFiddle - React, Tailwind, and code Playground

by Miklos Nagy

JavaScript

function addTogether(...arguments){
if (arguments.length === 1 ){
  const [firstArg] = arguments
  
  if(firstArg instanceof Array) return addTogether(...arguments)
  
}
return arguments.reduce((a, b)=> a+b)
}

document.body.innerHtml =addTogether(1,2,3));