How can I remove an element from the array which was pushed in with push?
animals = []
class Cat
cat = new Cat
animals.push cat
now can I say something like
animals.pull cat
to take the cat away from the array? Presuming that the cat variable is the same one that was pushed inside. I am just trying to create a kind of a dynamic collection..
index = animals.indexOf cat
animals.splice index, 1 if index isnt -1
Remember, a CoffeeScript array is just a JavaScript array, so you can look at any appropriate documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With