The parameter is optional, you can write function without any parameters.
Function without arguments
Function with arguments
Calling a Function:
When you run the above code, it will alert "Good Morning".Function Arguments (Function parameters)
Function with one argument
When you run the above code , it will alert "Good morning John".
Function with two arguments
When you run the above code , it will alert 25.
Using arguments as Array
If you don't know the parameters passes to the functions, there is still a way to call array methods on arguments.
Here also you will get the same result because arguments is an array, each argument you pass to the function is added in the "arguments" array.How to find how many arguments passed in a function ?
When you run the above code, it will alert "Total number of parameters : 4"
Sample usage of built in functions
When you execute the code, first it will alert "Sum is : 9010" and after using parseInt(), it will alert "Sum is : 100"