When working with TypeScript and JavaScript, we typically use either let or var to declare a variable. However, in Angular components, we do not use them even though Angular itself uses TypeScript. For instance,
export class ProductComponent implements OnInit {
productNumber = 5;
constructor() { }
ngOnInit() {
}
}
In the example above, we did not use let or var to define productNumber, yet it still functions as expected. Why is that?