Function
- Reusable procedures
- Allows us to write reusable, modular code
- We define a "chunk" of code that we can then excute at a later point.
How to define a function
function functionName() {
//code
}
Argument
- Inputs that functions accept
- Syntax
//argument === parameter
function functionName(parameter){
//code
}
- Functions with multiple arguments
function functionName(param1, paramN){
//code
}
//*** ORDER of parameters MATTERS ***//
Return
- Output of the function
- Ends function execution and specifies the value to be returned by that function.
* This post is a summary of Udemy Course "The Web Developer Bootcamp" by Colt Steele.
'TIL: Today I Learned' 카테고리의 다른 글
[TIL] 20201205 Callbacks & Array Methods (0) | 2020.12.05 |
---|---|
[TIL] 20201204 Leveling Up Our Functions (0) | 2020.12.05 |
[TIL] 20201202 Repeating Stuff with Loops (0) | 2020.12.02 |
[TIL] 20201201 JavaScript Object Literals (0) | 2020.12.01 |
[TIL] 20201130 JavaScript Arrays (0) | 2020.12.01 |