what is the difference between lambda and function in class in TS?

Viewed 186
class Person {
    name: string;
    age: number;
  
  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }
  
  getAge() {
    return this.age;
  }
  
  getName = () => {
      return this.name;
  }
}

getAge is normal function. getName is lambda function. Is there a difference between these in this context?

0 Answers
Related