Arrow Functions

suggest change

Versions

[{“Name”:“6”,“GroupName”:null},{“Name”:“7”,“GroupName”:null},{“Name”:“8”,“GroupName”:null}]

Introduction

Arrow functions are a concise way of writing anonymous, lexically scoped functions in ECMAScript 2015 (ES6).

Syntax

=> x*2 // A line break before the arrow will throw a ‘Unexpected token’ error

x*2 // A line break after the arrow is a valid syntax

Remarks

For more information on functions in JavaScript, please view the Functions documentation.

Arrow functions are part of the ECMAScript 6 specification, so browser support may be limited. The following table shows the earliest browser versions that support arrow functions.

Chrome| Edge | Firefox | Internet Explorer | Opera | Opera Mini | Safari |

|:—–:|:––:|:—––:|:—————–:|:—–:|:–––––:|:——:| | 45 | 12 | 22 | Currently unavailable | 32 | Currently unavailable | 10 |

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Arrow functions:
* Arrow Functions

Table Of Contents
11 Arrays
12 Objects
14 Classes
16 Map
17 Set
24 Loops
26 Arrow functions
27 Date
29 Scope
30 AJAX
35 Cookies
41 JSON
44 Fetch
45 Modules
46 Screen
64 Console
68 Symbols
73 Modals
76 Events
86 Proxy
89 WeakMap
90 WeakSet
102 Tilde