Last active
November 27, 2023 10:03
-
-
Save Integralist/7694814 to your computer and use it in GitHub Desktop.
[The distinction between "arguments" and "parameters"] #args #params #vs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Arguments are used when a function is being called. | |
| We pass arguments to functions. | |
| Parameters are set up when the function is defined. | |
| So it is said that parameters are used to define a function and arguments are used to invoke a function. | |
| These words are typically interchangeable but knowing the distinction can be handy. | |
| */ | |
| var myFunction = function(x,y,z){ // x,y,z are parameters | |
| return x+y+z | |
| }; | |
| myFunction(1,2,3); // 1,2,3 are arguments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment