Created
July 19, 2019 13:22
-
-
Save frankzickert/de730a268f8067217ff7ab1c312ece9f 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
/** input array */ | |
const arrInput = [1,4,2]; | |
/** prepare an output array */ | |
const arrOutput = new Array(); | |
/** loop through the index of the input array */ | |
for (var idx in arrInput) { | |
/** add to the output array ... */ | |
arrOutput.push( | |
/** ... the value of the input array plus 2 */ | |
arrInput[idx]+2 | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment