Answers for "how to create a function with parameters in JavaScript"

27

javascript function variable arguments

function foo() {
  for (var i = 0; i < arguments.length; i++) {
    console.log(arguments[i]);
  }
}

foo(1,2,3);
//1
//2
//3
Posted by: Guest on July-09-2020
1

parameters in javascript

function myFunction(x, y) {
  if (y === undefined) {
    y = 2;
  }
}
Posted by: Guest on December-23-2020
0

how to create a function with parameters in JavaScript

function name(param, param2, param3) {

}
Posted by: Guest on April-19-2021

Code answers related to "how to create a function with parameters in JavaScript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language