Currently, I am adding anonymous functions to an array in the following manner:
myArray.push(function(){ /* some unique code here */});
myArray.push(function(){ /* even more unique code here */});
Afterwards, I execute all the functions by doing
while (myArray.length) { myArray.shift().call();}
The query at hand is: How can I determine if a function already exists in myArray
? I attempted using toSource()
for comparison, but unfortunately, it did not yield the desired result... Any suggestions?
Appreciate any insight provided ahead of time.