Typescript中的数据类型

布尔类型(boolean)

image

数字类型(number)

image

字符串类型(string)

image

数组类型(array)

image

对象类型 (object)

image

元组类型(tuple)

image

枚举类型(enum)

image

枚举类型的出现,自然万物一般都不会直接以数字或者字符形式出现,因此一般会把一些事物定义成某种标志,例如性别,月份,事物状态,颜色(rgb)。这样就可以通过这些标志来描述这个事物。eq:enum Color {

   red,black = #000,white = #fff

任意类型(any)

image

null和undefined

image

void类型

image

never类型

image

猜你喜欢

转载自www.cnblogs.com/chujunqiao/p/11626142.html