Skip to content

Instantly share code, notes, and snippets.

@kitcat-dev
Created January 25, 2024 23:31
Show Gist options
  • Save kitcat-dev/1e8ba7e5282676f7578a345f418d3ed4 to your computer and use it in GitHub Desktop.
Save kitcat-dev/1e8ba7e5282676f7578a345f418d3ed4 to your computer and use it in GitHub Desktop.
Repetitive patterns I want to memorize
/**
* @param {any[]} array
* @param {any} x
* @param {any} y
*/
function swap(array, x, y) {
temp = array[x];
array[x] = array[y];
array[y] = temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment