DEV Community

Deepak
Deepak

Posted on

Find and remove the objects in the mutable Array using Ember Javascript

To find the records in the array by using many ways like find, findBy, peekRecord refer [https://guides.emberjs.com/v3.14.0/models/finding-records/] lets look at a simple example:

     array=[{name:"deepak"},{name:"aravind"},{name:"hari"}]

In this array you find the corresponding data by its property.

     remove=this.array.findBy("name","deepak");
     this.array.removeObject(remove);

This will remove the corresponding object from the mutable array.To remove the object is also have various methods. For more reference [https://medium.com/quangtn0018/ember-js-remove-objects-from-ember-mutable-arrays-f95192fbd0f0]

Top comments (0)