본문 바로가기
TIL: Today I Learned

[TIL] 20201203 Introducing Functions

by 김알리 2020. 12. 3.

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.