Functions – Beau teaches JavaScript




Functions are one of the fundamental building blocks in JavaScript. This video talks about function definitions, names, arguments, parameters, scope, and nesting functions.

Code:
🔗 https://codepen.io/beaucarnes/pen/gmLqQE?editors=0012

More info:
🔗 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions

Video on closures: https://www.youtube.com/watch?v=1JsJx1x35c0
Video on hoisting: https://youtu.be/C1PZh_ea-7I

Beau Carnes on Twitter: https://twitter.com/carnesbeau

⭐JavaScript Playlists⭐
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh


We’re busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Join our community at https://freecodecamp.com
Follow us on twitter: https://twitter.com/freecodecamp
Like us on Facebook: https://www.facebook.com/freecodecamp
Follow Quincy on Quora: https://www.quora.com/Quincy-Larson

Original source


19 responses to “Functions – Beau teaches JavaScript”

  1. I have a BIG **FUNCTIONS** question if anyone can help me —

    I am building a database driven web site.

    When a person enters DATA into the database on FORM #1 & FORM #4 — entering that data is FREE to enter.

    When a person enters DATA into the database on FORM #2 & FORM #3 — After Filling out the FORM then instead of pressing SUBMIT — They press NEXT — then they are taken to a PAYMENT PAGE FORM — SAY – PAYPAL or CREDIT CARD … Then when they FIll Out the Payment method they then press SUBMIT ( HOWEVER ) their data is NOT YET submitted into the database until PAYMENT CONFIRMATION APPEARS ((( THEN THEIR DATA IS SUBMITTED INTO THE DATABASE )))

    I am using a LINK to the payment page when they press NEXT

    AFTER THAT I DO NOT KNOW HOW TO CODE THE FUNCTION OF SUBMISSION TO DATABASE

    CAN ANYONE HELP ME WITH THIS ???

  2. Thank you so so so much! I have been struggling with this so bad. I read books, payed attention in class and i just couldn’t get the concept down. You explained everything so clearly in such a short time. More videos, please 🙂

  3. One more thing: in JS, functions are a bit counter-intuitive; why do you think so many people have trouble with them? I think it will help if you spend more time helping them understand the logic. I know you get it, but your job is to help US get it. You tend to be breezing through all this.

  4. Also, you need to turn up the volume for your vids: there are some of us who do NOT want to be leashed to our headphones and if you don't get that, then you can fk right off and we will move on and find someone else. I can barely hear you, and I have to keep going back and listen again; this is really annoying.

  5. Hey, I think I figured out how to overload functions in js. Using fall through with || parameter evaluation, the bad being one has to arrange evaluation in a linear and logical way, limiting or complicating as a result. The "good", explicit range declarations. ie this(can take 0 to 5 parameters to execute and only 0-5 parameters with the usual unused extras, where as I could make it to take a dynamic no. of parameters) Jeff do good or bad thing?

  6. Video title should be 'Function declaration'.

    There are 8 different ways of creating a function :

    * Function declaration
    * Function expression
    * Function expressions with grouping operator
    * Named function expression
    * IIFE
    * Function constructor
    * Object constructor
    * Arrow functions

    In future videos, I want to see when you would use one over the other.

Leave a Reply