Created
February 5, 2021 01:48
-
-
Save tofusoup429/2e6ef9053581c1da6e4eb8b4db5f5909 to your computer and use it in GitHub Desktop.
This file contains 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
let originalArray = [1,2,3,4,5,6]; | |
originalArray.forEach((element, index)=>{ | |
if(!element%2) console.log(index, element); | |
}) | |
/** | |
0 1 | |
2 3 | |
4 5 | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment