JavaScript Functions - 17

A Function contains basically 3 main components listed below:

  • Function head: Contains the function keyword (declarative), function name, and optional parameter(s).
  • Function body: Contains the curly braces (body scope) that holds a particular task (action). The task is in form of statements. These statements are locally scoped (exception of the use of var keyword).
  • Function caller: The calling function stores the action (result) for reuse anywhere in the program (script).

In this tutorial, you will learn the basics of JavaScript Functions in the following sections:

  1. Basic function syntax
    • Function head
    • Function body
    • Function caller (Calling Function)
  2. Ways of creating functions
    • Function declaration
    • Function Constructor
    • Function Expression (*)
      • Anonymous Function
      • Arrow Function
  3. Other features of functions
    • return statement
    • default statement(s)

Watch the entire JavaScript Series, including upcoming JavaScipt videos on YouTube: https://www.youtube.com/playlist?list=PLJGKeg3N9Z_Rgxf1Und7Q0u0cSre6kjif

Official website: https://techstackmedia.com

Check out the article: https://techstack.hashnode.dev/javascript-functions
Next article: https://techstack.hashnode.dev/javascript-function-expressions.

Become a patron to learn more: https://www.patreon.com/techstackmedia

Techstack Media is in partnership with Skillshare: http://bit.ly/tsm-skillshare.
Learn anything and get the required skill you need to kickstart a long-lasting career.

Website Request: [email protected]

Social Media:
✅ Facebook: https://facebook.com/techstackmedia
✅ Twitter: https://twitter.com/techstackmedia
✅ Instagram: https://instagram.com/techstackmedia
✅ LinkedIn: https://linkedin.com/in/techstackmedia

#javascriptfunctions #returnstatements #defaultparameters #functionbody #functionscope #javascriptfunction #arrowfunction #functiondeclaration #functionexpression #anonymousfunction #javascript #techstackmedia #codenewbies #learntocode #tutorial #webdev #DEVCommunity #DEVCommunityIN #NodeJS #programming #Hashnode #100DaysOfCode #opensource #techstack #media #womenwhocode #dev #blogging #writing #coding #webdevelopment

#javascript #javascript functions #returnstatements

JavaScript Functions - 17