老师您好
来源:8-6 手写一个getType函数,获取详细的数据类型

前端老师傅
2022-03-03
在这里输入代码
```export function getType(x: any): string {
return Object.prototype.toString.call(x).slice(8, -1).toLowerCase()
}
老师我有个方法会简单一点点,通过单元测试
写回答
1回答
-
双越
2022-03-03
好,这样也可以。
10
相似问题