執行 ❯
Node 伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
// no error on optional property, remove it and see what happens const car: { type: string, mileage?: number } = { type: "Toyota" }; car.mileage = 2000; console.log(car);
{ type: 'Toyota', mileage: 2000 }