Created
February 5, 2021 02:02
-
-
Save tofusoup429/a44531ce2982b20341a750eb848b3729 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]; | |
let returnValue = originalArray.forEach((element, index, array)=>{ | |
if(element%2) console.log(index, element, array); | |
}) | |
console.log('returnValue', returnValue) | |
/** | |
0 1 [ 1, 2, 3, 4, 5, 6 ] | |
2 3 [ 1, 2, 3, 4, 5, 6 ] | |
4 5 [ 1, 2, 3, 4, 5, 6 ] | |
returnValue undefined | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment