December 2017
Beginner
372 pages
10h 32m
English
Also known as fat arrow or lambda function, Arrow functions have been newly introduced in ES6. Arrow functions allow us to write concise code for anonymous functions. With an arrow function, we don't need to write the function keyword; we can directly just define the function.
Check out the following example of a function written in a traditional way:
function printFullName(firstName:string,lastName:string):string{ return firstName + " " + lastName;}
This same function can be written in a concise format using arrow notation, as shown here:
(firstName: string, lastName: string) => firstName + " " + lastName;
An arrow function is an equals symbol (=) followed by the greater than symbol (>). To the left of the arrow are the ...
Read now
Unlock full access