Created
March 2, 2021 22:16
-
-
Save pikajude/b9b28919d89961e39fd7084ac50a1c57 to your computer and use it in GitHub Desktop.
This file contains 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
// Here's a function that takes three inputs, aka arguments. | |
function myFunction(x, y, z) { | |
let a = x + y; | |
return a * z; | |
} | |
// Calling the function means that those values are "bound" to the variable names we chose when defining the function. | |
// This function call: | |
myFunction(1, 2, 3); | |
// is equivalent to: | |
{ | |
// the inputs: myFunction(x, y, z) | |
let x = 1; | |
let y = 2; | |
let z = 3; | |
// after those variables are set, the actual body of the function executes: | |
let a = x + y; | |
return a * z; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment