Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var nombres, ['camilo', 'andres', 'felipe'],
- indice = nombres.indexOf('andres');
- if(indice > -1){
- nombres.splice(index, 1);//[
- //Aquí se debe guardar el arreglo nuevamente en el localStorage.
- }
- var personas = [{id: 1, nombre: 'Camilo'}, {id: 2, nombre: 'Andrés'}];
- var indice = personas.findIndex(persona => persona.id == 1);
- //Ejecutar verificación y splice.
Add Comment
Please, Sign In to add comment