Skip to content

Instantly share code, notes, and snippets.

@kino6052
Last active August 31, 2018 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kino6052/c3db1e034dc2a12e02c9801244c95124 to your computer and use it in GitHub Desktop.
Save kino6052/c3db1e034dc2a12e02c9801244c95124 to your computer and use it in GitHub Desktop.
Elegant way to remove value from an array by index
let array = [1, 2, 3];
let index = 1; // Any index
let filteredArray = array.filter((el, i) => i !== index); // [1, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment