i tried many ways like removing the objects, but it suggests only through the index, but i want to remove the indexOf object from the above.
Asked
Active
Viewed 77 times
-4
-
Check This answer https://stackoverflow.com/questions/16491758/remove-objects-from-array-by-object-property – Sandip Bailkar Nov 26 '18 at 12:13
-
i want to delete the object using the object name itself. Not by using object's property. @sandip Bailkar – karthik shankar Nov 26 '18 at 12:19
1 Answers
1
I think your question is different than mentioned one . Please Provide code so we can help you.
In javascript you cannot destroy an object yourself. You can delete the property inside object using delete keyword. You can't delete objects, they are removed when there are no more references to them. Javascript is garbage collected, you don't need to delete objects themselves - they will be removed when there is no way to refer to them anymore. So when you use delete operator on them, you're helping the garbage collector by providing it more information about which objects can be reclaimed.

Sandip Bailkar
- 111
- 4