-4

enter image description here

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.

karthik shankar
  • 107
  • 2
  • 15

1 Answers1

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.