Skip to content

Instantly share code, notes, and snippets.

@prontiol
Created June 23, 2019 04:01
Show Gist options
  • Save prontiol/a216ab7c17f21ad337e18c5abea793fd to your computer and use it in GitHub Desktop.
Save prontiol/a216ab7c17f21ad337e18c5abea793fd to your computer and use it in GitHub Desktop.
Swap
function swap(array, index1, index2){
[array[index1], array[index2]] = [array[index2], array[index1]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment