Lambda Functions in Typescript

Lambda Functions in Typescript In Hindi – Programming Me Lambda Ko Anonymous Function Kaha Jaata Hai.

Lambda Function Anonymous Functions Ko Concise Karne Ke Liye Use Kiye Jaate Hai. Inko Arrow Functions Bhi Kahate Hai. Lambda Functions in TypescriptProgramming Me Lambda Ko Anonymous Function Kaha Jaata Hai.

Lambda Function Anonymous Functions Ko Concise Karne Ke Liye Use Kiye Jaate Hai. Inko Arrow Functions Bhi Kahate Hai.

Lambda Functions in Typescript in Hindi

Lambda Functions Ko Likhne Ke Liye 3 Parts Hote Hai. Firstly Parameters Likhe Jaate Hai Jo Bhi Hame Function Me Pass Karne Hai. Ye Optional Hai Kyuki Function Without Parameter Bhi Ho Sakta Hai. Second Lambda Function Ko Hum Fat Arrow Se Represent Karte Hai (=>). Third Part Statements Hoti Hai, Jisme Jo Bhi Instructions Set Hame Function Me Perform Krne Hai Vo Likhe Jaata Hai.

Fat Arrow Use Karne Se, Hame Function Keyword Likhne Ki Need Nahi Hoti. Lambda functions me Parameters Round Braces () Me Likhte Hai And Functions Ko Curly Braces {} Me Likhte Hai. Agar Function Me Only Ek Statement Hai To Curly Braces use Karne Kii Jarurat Nahi Hoti.

Syntax:

`(parameter1, parameter2, ..., parameterN) => expression;  `

Example:

```let sum = (x: number, y: number) : number =>
{
return x + y ;
}
sum (10,20); // return 30
```

Iss Example Me , Sum Ek Arrow Function Hai. Ye (x: Number, Y: Number) Parameter Ko Represent Kr Rahe Hai. : Number Return Type Hai. Fat Arrow, Function Parameter, And Function Body Ko Separate Krta Hai. Fat Arrow Ki Right Side Me Ek Ya Ek Se Jayda Code Or Statement Likh Sakte Hai.

At Last Lambda Functions Hum Isliye Use Karte Hai Jab Hum Baar Baar Function Keyword Type Nahi Krna Chahte Hai. Lambda Function Ke Pass ‘this’ Keyword And Arguments Ki Lexical Scoping Hai.

Arrow function kaa example without parameter

```let Print = () => console.log("Hello JavaTpoint!");
Print();```

Arrow function hum class me bhi as a property use karte Hai.

Example:

```class Student {
studCode: number;
studName: string;
constructor(code: number, name: string) {
this.studName = name;
this.studCode = code;
}
showDetail = () => console.log("Student Code: " + this.studCode + '\nStudent Name: ' + this.studName)
}
let stud = new Student(101, 'Abhishek Mishra');
stud.showDetail(); ```