Copy link to clipboard
Copied
Hello friends!
How to remove specific object from array
items = ['a', 'b', 'c', 'd'];
items.remove([0]); // "a" remove
(items = ['a', 'b', 'c', 'd']).splice(0, 1)
Copy link to clipboard
Copied
(items = ['a', 'b', 'c', 'd']).splice(0, 1)
Copy link to clipboard
Copied
If it is just about the first item, shift would also work
items = ['a', 'b', 'c', 'd'];
items.shift();
Copy link to clipboard
Copied
I would suggest exaclty same, but 'specific' item implies it has to work for wider scope of elements 🙂
Copy link to clipboard
Copied
Thanks @c.pfaffenbichler , the first item was just an example.
@Kukurykus worked really good! Thank you for your support