0% found this document useful (0 votes)
10 views2 pages

JavaScript Arrow Function Basics

Uploaded by

nonocex510
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

JavaScript Arrow Function Basics

Uploaded by

nonocex510
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JavaScript Arrow Function

Arrow functions were introduced in ES6.

Arrow functions allow us to write shorter function syntax:

let myFunction = (a, b) => a * b;

Before Arrow:

hello = function() {

return "Hello World!";

With Arrow Function:

hello = () => {

return "Hello World!";

It gets shorter! If the function has only one statement, and the statement
returns a value, you can remove the brackets and the return keyword:

Arrow Functions Return Value by Default:

hello = () => "Hello World!";


Note

You might also like