javascript - JS deletes elements based on key and returns the length. The difference with splice is that it deletes based on position and the length is not updated.
The element is deleted, but the original address is still retained, so the subsequent elements must be moved forward. This will reduce the number of elements and update the length
The element is deleted, but the original address is still retained, so the subsequent elements must be moved forward. This will reduce the number of elements and update the length
Will be updated
For your needs, you can write a method yourself and encapsulate splice: