function verifyType(...target) {
target.forEach((v, i) => {
let type = Object.prototype.toString.call(v);
console.log(`第${i + 1}个的type类型为${type.slice(8, -1)}`);
});
}
测试
verifyType(1, "1", true, BigInt(19), undefined, {}, null, Symbol(1));
结果