Imagine I have an array of functions x = [f1,f2,f3,f4]
that my user created. The user also has the ability to remove these functions later in the code.
Here's the challenge: How can a user request to remove f3
, for instance, without knowing its position in the array?
I thought about implementing a function called x.remove(f3)
and comparing the pointers of the argument with the items in the array, but how can this be achieved in JavaScript?