1.

What is the use of arrow function in Angular 2?

Answer»

They are additionally called lambda features in different languages. Using fats arrow (=>) we drop the want to use the 'function' keyword. Parameters are HANDED in the angular brackets <>, and the characteristic expression is enclosed inside the CURLY brackets {}.

Example

items.forEach((a) => {
    console.log(a);
    incrementedItems.push(a+1);
});



Discussion

No Comment Found