DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 963,503 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
florent giraud
florent giraud

Posted on

[Reminder-2] Arrow Function

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

Top comments (0)

Visualizing Promises and Async/Await 🤯

async await

☝️ Check out this all-time classic DEV post