[Reminder-2] Arrow Function
florent giraud
Posted on May 9, 2020
I am assuming you are using "use strict"
- Arrow function syntax is
() => {}
- If you have one parameter you can delete parantheses.
- If you are doing one action, you can delete the curly braces.
() => console.log("hi")
- It has an implicit return
- It create a new Scope as Normal function (watch my last reminder if you want more).
- It doesn't bind context like classic function. That means 'this' will never be bind and will be undefined or window.
- It cannot act as a constructor like normal function
source: es5 to esnext
💖 💪 🙅 🚩
florent giraud
Posted on May 9, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.