使用 typeof 和 constructor 共同判断,数组 = object + Array,字符串 = string + String 一.判断是否为数组类型 二.判断是否为字符串类型 参考内容链接