Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rxluz/d571d409a79f35a82da6c1624efa7e28 to your computer and use it in GitHub Desktop.
Save rxluz/d571d409a79f35a82da6c1624efa7e28 to your computer and use it in GitHub Desktop.
JS Data Structures: Arrays, see more at: https://medium.com/p/e1bc57bda950
const animals = ["elephant", "monkey", "snake", "lion"];
for (let index = 0; index < animals.length; index++) {
animals[index] = animals[index + 1];
}
animals.length = animals.length - 1;
console.log(animals);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment