<script>
function getType(arr) {
const type = Object.prototype.toString.call(arr);
const spaceIndex = type.indexOf(' ');
const lastType = type.slice(spaceIndex + 1, -1);
return lastType.toLowerCase();
}
</script>
JavaScript 手写一个getType获取数据类型
最新推荐文章于 2024-07-25 09:24:40 发布