Created
March 28, 2019 03:12
-
-
Save rcdexta/dff2c2669edf02b16669f64efa39e7f4 to your computer and use it in GitHub Desktop.
iterate array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.each([1, 2, 3], (value, index) => { | |
console.log(value) | |
}) | |
[1, 2, 3].forEach((value, index) => { | |
console.log(value) | |
}) | |
_.forEach({ 'a': 1, 'b': 2 }, (value, key) => { | |
console.log(key); | |
}); | |
({ 'a': 1, 'b': 2 }).forEach((value, key) => { // !error | |
console.log(key); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment