underscore.js๋ ๊ธฐ๋ณธ JavaScript ๊ฐ์ฒด๋ค์ ํ์ฅํ์ง ์๊ณ , ํจ์ํ ํ๋ก๊ทธ๋๋ฐ์ ์ง์ํ ์ ์๋ 100๊ฐ์ง ์ด์์ ํจ์๋ฅผ ๊ฐ์ง ์ ์ฉํ JavaScript ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค.
_.each(list, iteratee, [context]);
var someOtherArray = ["name","patrick","d","w"];
_.each([1, 2, 3], function(num) {
console.log( this[num] );
}, someOtherArray);
// "patrick"
// "d"
// "w"
source ๊ฐ์ฒด์ ์๋ ๋ชจ๋ ํ๋กํผํฐ๋ฅผ destination ๊ฐ์ฒด์ ๋ณต์ฌํ๊ณ , destination ๊ฐ์ฒด๋ฅผ ๋ฆฌํดํฉ๋๋ค. source๋ ์์๋๋ก ์ฒ๋ฆฌํ๋ฏ๋ก, ๋ง์ง๋ง source์ ํ๋กํผํฐ๊ฐ ์์ ์ธ์๋ค์ด ๊ฐ์ง ๊ฐ์ ์ด๋ฆ์ ํ๋กํผํฐ๋ฅผ ๋ฎ์ด์ธ ์ ์๋ค.