SOURCE

// 数组 API
let arr = [1,2,'a','b',true,{x:1,y:2},[3,4,5],function(){}]
// console.log(arr)

// ...rest 压缩与展开
let arr1 = [...arr]
console.log(arr1)
arr=[...arr,7,8,9]
console.log(arr)
console.log('---------------')

// Array.of 打包
let items = [1,2,3]
console.log(Array.of(...items))

console.log('---------------')

// Array.from() 类数组(对象) 包装成数组
const likeArr = {
    0:'red',
    1:'blue',
    2:'green',
    length:3,
}
const data = Array.from(likeArr)
console.log(Array.isArray(likeArr) ? 'likeArr -> Array' : 'likeArr -> No Array')
console.log(Array.isArray(data) ? 'data -> Array' : 'data -> No Array')

console.log('---------------')
for(let item of data){
    console.log(item)
}
setTimeout(console.log(1),1000)
console.log('---------------')

console 命令行工具 X clear

                    
>
console