Guest User

Untitled

a guest
Apr 25th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. var nombres, ['camilo', 'andres', 'felipe'],
  2. indice = nombres.indexOf('andres');
  3. if(indice > -1){
  4. nombres.splice(index, 1);//[
  5. //Aquí se debe guardar el arreglo nuevamente en el localStorage.
  6. }
  7.  
  8. var personas = [{id: 1, nombre: 'Camilo'}, {id: 2, nombre: 'Andrés'}];
  9.  
  10. var indice = personas.findIndex(persona => persona.id == 1);
  11. //Ejecutar verificación y splice.
Add Comment
Please, Sign In to add comment