Javascript

Topic: JS Functions

How to Calling a Function with Arguments?

When you call a function, you can pass along some values to it, these values are called arguments or parameters.These arguments can be used inside the function.You can send as many arguments as you like, separated by commas (,)myFunction(argument1,argument2)Declare the argument, as variables, when you declare the function:function myFunction(var1,var2){some code}The variables and the arguments must be in the expected order. The first variable is given the value of the first passed argument etc.

Browse random answers: