Apuntes
Arrow functions
Contenido del apunte (1)
Página 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
Información
- Descripción
- A-Level Javascript Apunte sobre Arrow functions, creado por James Drummond el 04/09/2015.
- Creado por
- James Drummond
- Visitas
- 7
- Etiquetas
- Valoración