JavaScript Functions: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
The names listed in the function definition are the function '''parameters'''. The values passed to the function are the function '''arguments'''. | The names listed in the function definition are the function '''parameters'''. The values passed to the function are the function '''arguments'''. | ||
A JavaScript function does not specify data types for its parameters, it does not perform type checking on its arguments and it does not check the number of arguments received. | |||
==Missing Argument== | |||
If a function is called with missing arguments, the corresponding argument values are set to <tt>undefined</tt>. | |||
=Declaration= | =Declaration= |
Revision as of 01:19, 10 December 2020
Internal
Overview
function name(parameter1, parameter2, parameter3) {
// code to be executed
}
Function Parameters and Arguments
The names listed in the function definition are the function parameters. The values passed to the function are the function arguments.
A JavaScript function does not specify data types for its parameters, it does not perform type checking on its arguments and it does not check the number of arguments received.
Missing Argument
If a function is called with missing arguments, the corresponding argument values are set to undefined.