SOURCE

//定义:var array=new array()
//var aee=[]
//push:往后加  unshift:往第一个加   pop:往后删  shift:删除第一个
const arr = [1,2,3,4,5,6];
var length = arr.length;
for (var i = 0; i < length; i++) {
    console.log(arr[i]);  
}

const arr1 = [1,2,3,4,5,6];
var length = arr1.length;
var i=0;
while(i<length){
    console.log(arr1[i]);
    i++;
}

var array = ['a', 'b', 'c', 'e'];
array.forEach((a)=> {
  console.log(a);
});

//foreach需要一个函数作为参数
var array2 = ['f', 'g', 'h'];
array2.forEach(function(element) {
  console.log(element);
});

 var bookList = [
            {"id":10,"title":"Web前端开发","price":99.9},
            {"id":11,"title":"C++","price":80.9},
            {"id":12,"title":"Python","price":100.9}
          ]
         console.log(bookList.map(book =>{
            return {title:book.title,price:book.price}
          }))

 
console 命令行工具 X clear

                    
>
console