Last active
January 20, 2019 06:50
-
-
Save rxluz/99eeb1048287c66d39590aef9c6c8608 to your computer and use it in GitHub Desktop.
Big O in JS: The basic that you need to know, see more at: https://medium.com/p/a5abb45570fa
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
const printItemAndNextItem = (...items) => | |
items.forEach( | |
(item, index) => items[index + 1] && console.log(item, items[index + 1]), | |
); | |
/* will return: | |
1 2 | |
2 3 | |
3 4 | |
*/ | |
printItemAndNextItem(1, 2, 3, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment