检测数组

第一种instanceof Array 来检测数组

if(value instanceof Array){
  //数组操作
}

第二种使用Array.isArray()来检测数组

if(Array.isArray(value)){
  //数组操作
}

最后更新于