Answers for "javascript pass all arguments to another function"

1

javascript pass all arguments to another function

function func1() {
  const reverse = func2(...arguments); // "rest operator" passes arguments
  return reverse.join("");
}

function func2() {
  return Array.from(arguments).reverse();
}

func1("a", "b", "c"); // "cba"
Posted by: Guest on June-02-2021
0

js use param object or multiple

Like many of the others, I often prefer passing an options object to
a function instead of passing a long list of parameters, but it
really depends on the exact context.

I use code readability as the litmus test.
Posted by: Guest on October-13-2020

Code answers related to "javascript pass all arguments to another function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language