检查是不是数组的方法

1  <script>
2         var arr = [5, 4, 2, 1, 3, 6, 8, 7];
3         console.log(Array.isArray(arr));//true       
4  </script>

语法

Array.isArray(arr)

源图片

猜你喜欢

转载自www.cnblogs.com/andyZhang0511/p/10805014.html
今日推荐