typescript

type Person = {

  name : string

  birthday : Date | null

}

const p:Person = {name:"Tom", birthday:null}

 

type FT  =  (id:number)==>string

const ft : FT = (id:number)==>id.toString

 

class A{

  readonly 

}

 

type alias

type Secret = "secret"

type Person = {

  name : string

  birthday : Date | Secret

}

type Person_ = [string, Date]

const p:Person = {name:"Tom", birthday:new Date()}

const p1:Person_ = ["Tom", new Date()]

const [name, birthday] = p1

 

posted @ 2020-10-09 14:17  MengYang2  阅读(74)  评论(0)    收藏  举报