Arrow Functions – Beau teaches JavaScript



An arrow function in ES6 has a shorter syntax than a normal function and does not bind its own this.

💻 Code: http://codepen.io/beaucarnes/pen/KWEVwQ?editors=0010

🔗 Resources: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

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

⭐JavaScript Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶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
Read great tech articles at https://medium.freecodecamp.com

source

This Post Has 29 Comments

  1. Rohit Kumar

    An arrow function in ES6 has a shorter syntax than a normal function and does not bind its own """this""". What does that even mean?

  2. learn it all

    how do i write the arrow i couldn't find it on my keyboard

  3. DFCE82

    Just the info I needed! Without too much blabla! Short and very helpful video! Thanks a lot! 🙏

  4. Viktor Chernov

    I don't get how it works:
    “`
    function Person() {
    this.age = 0;

    setInterval(() => {
    this.age++;
    }, 1000);
    }
    var p = new Person();
    console.log(p.age);
    “`
    return 0. But you said that it should return 1

  5. C G O

    This is the second js instructor I've come across and he also talks really fast, like taboo they avoid to talk about lol. But I like how clean examples were

  6. Nostalgic Beach

    just a reminder to myself if I ever returned here one day to try learning javascript again: don't do it..just give up

  7. IM on the rise

    I really would like to grasp these concepts, but it seems as though JavaScript is some sort of 'bottomless pit' of being unsure about what one learns.

  8. D

    Great video! I had forgotten arrow functions and just recently started refreshing on JavaScript and this helped me gain the understanding I needed.

  9. Yesh

    Can someone explain what this statement would be doing?
    var func = () => ({var : 1})
    I am not able to follow what the part inside the curly brace would be used for {var : 1}

  10. Dos Taquitos

    Just hearing your voice brought me relief because I knew it was going to be a simple explanation with lots of examples. Thank you! I love your videos through the fcc exercises

  11. Tavo Zapata

    Top man!
    Finally someone that explains this simply enough.

  12. Ibrahim

    you guys have a clear,short and easily understandable videos.
    Thankyou!

  13. Sergi

    I think this needed a more in depth video. Arrow functions change how things like hoisting works.

Leave a Reply