I have a question, is there a way to pass the arguments of a function as an array? To be more specific, let’s say I have a function
foo = function(arg1, arg2, arg3){
// something
}
of course, that’s called like this:
foo(1, 2, x);
but can I somehow pass the arguments as an array? like this:
bar = [1, 2, x]
foo(bar);
I know that particular code doesn’t work, but I’m wondering if there’s some syntactic sugar that will let me do this. I’m doing some work with the drawing API and I don’t feel like passing 17 separate variables to a function.
Thanks