class Point {
x: number;
y: number;
// Normal signature with defaults
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
}
public class Car{
private maker: string;
private model: string;
private manufactureYear: Date;
constructor(maker: string, model: string, manufactureYear: Date){
this.maker = maker,
this.model = model,
this.manufactureYear = manufactureDate
}
carInfo(){
return{
this.maker,
this.model,
this.manufactureDate
}
}
}
const car = Car("Nissan", "GT-R", new Date(2007, 12, 6))