Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 234 Bytes

File metadata and controls

18 lines (13 loc) · 234 Bytes

检测数组

第一种instanceof Array 来检测数组

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

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

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