DEV Community 👩‍💻👨‍💻

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)

We are hiring! Do you want to be our Senior Platform Engineer? Are you capable of chipping in across sysadmin, ops, and site reliability work, while supporting the open source stack that runs DEV and other communities?

This role might just be for you!

Apply now