_typeof 🔥【获取对象类型】
描述
返回数据类型
# 1.示例
import { _typeof } from 'sf-utils2'
_typeof('') // String
_typeof(null) // Null
_typeof({}) // Object
_typeof(Promise.resolve()) // Promise
_typeof([]) // Array
_typeof(new Set([])) // Set
_typeof(new Map([[1, () => {}]])) // Map
_typeof(0) // Number
_typeof(0.22) // Number
_typeof(new Date()) // Date
_typeof(window.cccc) // Undefined
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 2.入参说明
| 参数 | 说明 | 类型 | 是否必填 |
|---|---|---|---|
| args | any | 是 |
# 3.源码
上次更新: 2024/01/08, 21:47:25