Notes
Arrow functions
Content of the notes (1)
Page 1
The syntax is like:
[1, 2, 3].map(num => num * 2)
//
Which is equivalent to:
[1, 2, 3].map(function (num) { return num * 2 })
//
So this is just shorthand for writing a callback.
Arrow functions are just for expressions:
- They do not have this or arguments
Information
- Description
- A-Level Javascript Note on Arrow functions, created by James Drummond on 04/09/2015.
- Created by
- James Drummond
- Views
- 7
- Tags
- Rating