javascript remove from array by index
//Remove specific value by index
array.splice(index, 1);
javascript remove from array by index
//Remove specific value by index
array.splice(index, 1);
Remove element from array
const apps = [
{id:1, name:'test1'},
{id:2, name:'test2'},
{id:3, name:'test3'}
]
//remove item with id=2
const itemToBeRemoved = {id:2, name:'test2'}
apps.splice(apps.findIndex(a => a.id === itemToBeRemoved.id) , 1)
//print result
console.log(apps)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us