Most modern languages support functions/methods with variable arguments, so does Java Script. If you google for it you will find may good articles about it, the one I used was this one because it illustrates the difference between the different ECMA script versions. The medini JS engine is ES 5 so we only have the option to use the "arguments" local object. Which is working pretty good though. Note that the article well explains that that "arguments" object is not an array. I did not try the proposed way to convert it to an array but just iterated normally in this example:
function tagAsTest(/* no */) {
// special "arguments" object (ECMA 10.1.8) - like an array but not special features as forEach or so
for (var i=0; i<arguments.length; i++){
alert(arguments[i]);
};
}
tagAsTest("foo", "bar", "foo");This will obviously bring up the alert dialog 3 times.
Hope that gave you some hints how to improve your scripting!
Jan