-
-
Save elliotlarson/528d66f1f34ba0db9503b97cd8779cd6 to your computer and use it in GitHub Desktop.
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 newCharacters = [ | |
...characters.slice(0, index), // all the items before the update item | |
newName, // add the newName in place of the old name | |
...characters.slice(index + 1) // all the items after the update item | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment