Is it possible to pass multiple arguments using a single variable? For example, if I wanted to do something like:
function foo(x,y){ document.write("X is " + x); document.write("Y is " + y); } var bar = "0,10"; foo(bar);
The above example is a simplified example of what I was trying to do. This does not work (because the "bar" is defined as a single argument). I know that there are simpler ways to implement this with arrays.
So, I ask this question mainly out of curiosity - is it possible for the variable "bar" to be detected as not one, but 2 arguments?
Thanks!
javascript argument-passing
user418797
source share