Home > other >  How to remove object-item from object in Javascript
How to remove object-item from object in Javascript

Time:07-02

enter image description here

How can I delete event(object) from my events(object). It seems to be pretty simple but I'm kinda stuck trying to figure it out for like an hour

CodePudding user response:

const events = events.filter(ev => ev.title !== 'TEST ZDJEC');

This will remove 3rd one, since in filter you are specifying that you want to keep only elements with title different than 'TEST ZDJEC';

  • Related