This is a common case in django ORM.
from django.db import models
class Author(models.Model):| // we have an array of objects, we want to remove one object using only the id property | |
| const apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}]; | |
| // get index of object with id of 37 | |
| const removeIndex = apps.findIndex( item => item.id === 37 ); | |
| // remove object | |
| apps.splice( removeIndex, 1 ); | |