is splice a modern method in js

should i use it to remove an element from an array
3 Replies
Jochem
Jochem4mo ago
Yes Though depending on the use case you can use filter instead
bfmv
bfmvOP4mo ago
oh actually i have an array of cards, and each card has a "remove button" when pressed, i want the cards to be totally removed from the array list ( not hidden ) is splice more suitable here or filter
Jochem
Jochem4mo ago
both can work, depends on how you set the cards up. Safest is probably to use a stored ID for the card and use filter

Did you find this page helpful?