I am coding in JavaScript and was wondering how I would go about queueing functions in an array when called until a execute function is called causing the rest of them to be calculated.
the code that I have for something like this and was just wondering if it would work.
addNegationTask(x)
{
this.value = this.value * -1
// this adds the equation to the array
this.tasks.push(x => value * -1)
return this.value;
}
I have other functions that follow a simular route, any answers on the matter would be greatly apriciacted.