Skip to content

Instantly share code, notes, and snippets.

@emeaguiar
Created January 2, 2019 18:18
Show Gist options
  • Save emeaguiar/3edeb8bd80da1dcacc4bf6f063fdcc9e to your computer and use it in GitHub Desktop.
Save emeaguiar/3edeb8bd80da1dcacc4bf6f063fdcc9e to your computer and use it in GitHub Desktop.
const array = [ 'foo', 'bar', 'baz' ];
// Empezando en la posición 1, elimina los dos siguientes elementos
const removedElement = array.splice( 1, 2 );
// [ 'foo' ]
console.log( array );
// [ 'bar', 'baz' ]
console.log( removedElement );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment