1. typeof(undefined) // "undefined"
    2. typeof(null) // "object"
    3. typeof([1,2]) // "object"
    4. typeof({a:1}) // "object"
    5. typeof('123') // "string"
    6. typeof(1) // "number"
    7. typeof(true) // "boolean"
    8. typeof(Array) // "function"
    9. typeof(() => {}) // typeof 箭头函数返回也是 "function"

    谨记typeof的返回值都是 string类型

    1. typeof(typeof(null)) // "string"
    2. typeof(typeof(undefined)) // "string"
    3. typeof(undefined) === undefined // false
    4. typeof(undefined) === "undefined" // true

    特别的: null返回的是”object” ,undefined返回还是”undefined” typeof 可以返回的类型为:number、string、boolean、undefined、object、function

    判断数据是否是数组类型:

    1. arr = []
    2. arr instanceof Array // instanceof判断方法
    3. Array.prototype.isPrototypeOf(arr) // 原型链判断
    4. Array.isArray(arr) // JS 数组方法Array中的isArray方法

    原文链接:https://blog.csdn.net/qq_41860203/article/details/112602154