I want to delete object from array by id using Ramda. For example:
const arr = [
{id: '1', name: 'Armin'},
{id: '2', name: 'Eren'}, <- delete this object
{id: '3', name: 'Mikasa'}
];
You can user filter
function, with a composed functions propEq & not
const result = filter(
compose(
not,
propEq('id', 2)
),
array,
)
console.log(result)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments