Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get all arguments from function

function func1(a, b, c) {
// arguments is an Array-like object accessible inside functions that contains 
// the values of the arguments passed to that function.
  console.log(arguments[0]);
  // expected output: 1

  console.log(arguments[1]);
  // expected output: 2

  console.log(arguments[2]);
  // expected output: 3
}

func1(1, 2, 3);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #arguments #function
ADD COMMENT
Topic
Name
3+7 =