Tuples
JS原生只有Array,而Tuple是TS才有提供的
type Vehicle = [string, string, Date]
type VehicleArray = (string | Date)[]
let BMWMotor: Vehicle = ['BMW', 'motorcycle', new Date(2019, 2, 17)];
let JaguarOffRoad = <Vehicle>['Jaguar', 'off-road', new Date(2019, 1, 9)];
let ToyotaRV = ['Toyota', 'recreational', new Date(2019, 3, 15)] as Vehicle;
tuple比array更有侷限性,除了元素的個數必須固定外,格式必須完全吻合