2.5 - Function Parameters & Return
2.5 - Function Parameters & Return
Review
Code is run line-by-line in a code file
We can "chunk" code into "mini-programs" called functions
We can "call" or run our custom functions as often as we want
JavaScript has lots of built-in functions.
Some take parameters: Math.min(10, 4, 29, 13, 1, 99, 2)
Some take no parameters: Math.random()
Some give back (return) a value: Math.random() or prompt("Pick a number from 1 to 10")
Some do not return anything: console.log("Game Over")
Function Parameters & The Return Statement
Everything is in the repository for this lesson - click here to get it.