Can multiple arguments be passed using a single variable? For instance, if I want to achieve the following:
function foo(x,y){
document.write("X is " + x);
document.write("Y is " + y);
}
var bar = "0,10";
foo(bar);
The mentioned example is a simplified version of what I am attempting. It does not work as intended (since "bar" is treated as a single argument). I am aware that there are alternative methods like using arrays.
Therefore, my question arises out of curiosity - is it feasible to recognize the "bar" variable as two separate arguments?
Thank you!