Visibilité des Propriétés
class Customer {
public firstName: string;
private _age: number;
}
const customer = new Customer();
// error TS2341: Property '_age' is private and only accessible within class 'Customer'.
console.log(customer._age);const customer = new Customer();
customer['_age'] = 30;Mis à jour