Created
May 10, 2021 14:30
-
-
Save RahmatSaeedi/ba1af7e33a21f9964cba7469b22f54fa to your computer and use it in GitHub Desktop.
CodeSignal - Arcade - Intro - JS - Array Replace
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
function arrayReplace(inputArray, elemToReplace, substitutionElem) { | |
return inputArray.map(i => i==elemToReplace? substitutionElem:i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment