Skip to content

Instantly share code, notes, and snippets.

@AleksandrMihhailov
Created February 11, 2018 20:05
Show Gist options
  • Save AleksandrMihhailov/191df91e3b8c4490a5bf5f8deddcdff6 to your computer and use it in GitHub Desktop.
Save AleksandrMihhailov/191df91e3b8c4490a5bf5f8deddcdff6 to your computer and use it in GitHub Desktop.
JS trick
t[a] = t.splice(o[i - 1 - a], 1, t[a]);
// is equal to...
t[a] = t[o[i - 1 - a]] = t[a];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment