Last active
November 25, 2016 18:13
-
-
Save juliovedovatto/1a46357888dde6253324ea2505ed9dfa to your computer and use it in GitHub Desktop.
Javascript snippet to swap elements in array
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
// one line code to swap elements in array | |
arr[x] = [arr[y],arr[y] = arr[x]][0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment