var arr1=[]
console.log(arr1)//[]
arr1[0]=1
arr1[1]=2
console.log(arr1)//[1,2]
arr1[1]=3
console.log(arr1)//[1,3]
var arr2=[1,2,3,4,5,6,7]
arr2.shift()
console.log(arr2,"arr2")
arr2.unshift(0)
console.log(arr2)
arr2.pop()
console.log(arr2)//[]
arr2.push(8)
console.log(arr2)//[]
var arr3=[1,2,3,4,5,6,7]
arr3.splice(2,0,'a','b','c')
console.log(arr3)
console.log(arr3.length)
var arr4=new Array(9,10)
console.log(arr4)
var a=1,b=[],c={}
console.log(typeof(c))
console.log(Array.isArray(c))
判断标量C是不是数组,如果是数组,则输出“是数组”三个字
否则输出“不是数组”四个字
if(Array.isArray(b)==true){
console.log('是数组')
}else{
console.log('不是数组')
}
Array.isArray(c)==true?console.log('是数组'):console.log('不是数组')
console.log(Array.isArray(c)?'是数组':"不是数组")
var arrC=[1,2,3,4,5,6,7,8]
for(var i=0;i<=arrC.length;i++){
console.log(arrC[i])
}
for (var i=arrC.leng-1;i>=0;i--){
console.log(arrC[i])
}
for(i of arrC){
console.log(i)
}