Easy learning with example program codes

typescript arrow function

A TypeScript function is a group of statements which is used for performing a specific task. It provides the facility of code re-usability.

Typescript lambda or arrow functions are used to represent anonymous functions.

Parts of Arrow / Lambda function:

  • Parameters
  • Arrow notation/lambda notation (=>)
  • Statements

Typescript Arrow / Lambda function syntax:

( [param1, parma2,…param n] )=>statement;

Typescript Arrow / Lambda function example:

var calculateSquare = (num:number)=> {    
   num = num * num; 

Try it:

JS Bin on

Please follow and like us:

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki