📅  最后修改于: 2022-03-11 14:48:22.652000             🧑  作者: Mango
// Declare a tuple type
let x: [string, number];
// Initialize it
x = ["hello", 10]; // OK
// Initialize it incorrectly
x = [10, "hello"]; // Error
Type 'number' is not assignable to type 'string'.Type 'string' is not assignable to type 'number'.23222322Type 'number' is not assignable to type 'string'.Type 'string' is not assignable to type 'number'.Try