I've searched a bit and come up with .apply() and .call(), but they don't seem to behave as I need them to.
Say I have
function example(someparam, anotherparam, finalparam){
}
Am I able to dynamically pass it an array to match those parameters? Such that if I was trying to pass value1 to 'someparam,' value2 to 'anotherparam,' and value3 to 'finalparam,' I could do so with an array like [value1, value2, value3]?
Say if those values were:
valueArray = [value1, value2, value3];
I thought it might be possible to do
example.apply(valueArray);
Is this possible? I understand that it's possible to deal with parameters dynamically by passing objects, but I need this to not require that the target function expects an object.