inside your function sortProduct array variable ‘arguments’ will have all passed arguments into the function. So, you can just loop through it.
You don’t need specify any arguments in function definition for this to work.
it’s actually was not what I meant, but if you can pass array into the function - it’s great.
In situation when you do need to pass not known number of arguments and access it in the function this should work for you:
someFunction(3, 4, 5);
function someFunction()
{
alert(arguments);
}
alert should print “3,4,5”, since it has each argument as array item of arguments array.