for()๊ณผ forEach()
MDN_Array.prototype.forEach() > forEach() ๋ฐฐ์ด์ ์๋ ๊ฐ ์์์ ๋ํด ํ๋์ฉ ์ฝ์ด ๊ฐ๋ฉด์ ์ฝ๋ฐฑ ํจ์๋ฅผ ํธ์ถํ๋ค. ์ญ์ ํ๊ฑฐ๋ ์ด๊ธฐํํ์ง ์์ ์ธ๋ฑ์ค ์์ฑ์ ๋ํด์๋ ์คํํ์ง ์๋๋ค. ์ฝ๋ฐฑ ํจ์ ํ๋ผ๋ฏธํฐ : ์๋ฆฌ๋จผํธ ๊ฐ, ์ธ๋ฑ์ค, ๋ฐฐ์ด ์ ์ฒด let list = ["A", "B", "C"]; list.forEach(function(el, index, all){ log(el + ":" + index + ":" + all); }); //A:0:A,B,C //B:0:A,B,C //C:0:A,B,C ์ฝ๋ฐฑ ํจ์๋ฅผ ๋ถ๋ฆฌํ ์ ์์ด ๋
๋ฆฝ์ฑ์ด ์ข์์ง๋ค. var list = ["A", "B", "C"]; var list2 = ["D", "F", "G"]; var fn = function(el..