Underscore: each
2019년에 Hexo 블로그에 쓴 글을 옮겨 왔습니다. 당시 이해를 그대로 두었습니다.

_.each = function(collection, iterator) {
if (Array.isArray(collection)) {
for (let index = 0; index < collection.length; index++) {
iterator(collection[index], Number(index), collection);
}
} else {
for (let key in collection) {
if (key !== 'someProperty')
iterator(collection[key], key, collection);
}
}
};