Underscore: each

each pass

1
2
3
4
5
6
7
8
9
10
11
12
_.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);
}
}
};

CodeWars 6kyu. Build a pile of Cubes

CodeWars 6kyu. Build a pile of Cubes

Find the largest number of cubes can be piled.

CodeWars 6kyu. Consecutive strings

CodeWars 6kyu. Consecutive strings

Find longest k consecutive strings

CodeWars 6kyu. Playing with digits

CodeWars 6kyu. Playing with digits

Play with digits 😊

CodeWars 6kyu. Find The Parity Outlier

CodeWars 6kyu. Find The Parity Outlier

Find one odd / even number in last all even / odd numbers.

CodeWars 6kyu. Decode the Morse code

CodeWars 6kyu. Decode the Morse code

Decode Morse code to plain text

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×