SOURCE

let map = new Map([[1, 2], [3, 4]]);

let arr = [1, 2, 3, 4];
let objArr = [{a: 2, b: { c: 3}}];

let obj = {1: 2, 3: 4};

let str = '1234';

let set = new Set([1, 2, 3, 4]);

function forEachFn(item, index, arr) {
    console.log(item, index, arr, this.a);
}

// forEach方法
set.forEach((item, index, arr) => console.log(item, index, arr, this.a), {a: 1})
arr.forEach(forEachFn, {a: 1});
map.forEach(forEachFn, {a: 1});

console.log(objArr.map(item => {item.a++;item.b.c++; return item}), objArr);

for(let i in arr) {
    console.log('for of', i);
}
console 命令行工具 X clear

                    
>
console