Skip to content

type of 和 key of 的区别

  • typeof 操作符可以用来获取一个变量或对象的类型
  • typeof操作符可以用来判断数据的类 型是否是某个原始类型(number、string、boolean,...)和对象类型。
  • keyof 检查键是否存在 获取某种类型的所有键 返回联合类型

Welcome to the site