获取类型 叫我静静 2022-05-16 135 阅读1分钟 function getType(x) { const originType = Object.prototype.toString.call(x); const spaceIndex = originType.indexOf(' '); const type = originType.slice(spaceIndex + 1, -1); return type.toLowerCase(); //'string' }