Skip to content

TypeScript

基本语法

array 类型 const foo = [] as string[]

key-value object 类型声明

ts
items: {
  [key: string]: any;
}

常见问题

Right side of assignment cannot be destructured

const {a, b} = foo; // foo is null or undefined

Released under the CC-BY-NC-4.0