The question is how I can pass an undefined number of arguments to a function in Javascript. After googling for hours, I've finally gathered some enough information and have done some tests. Here are the 4 huge lines of efforts. :P
function eatanything(args)Google has all the answers you are seeking for. It is just a matter of giving a spot on keyword(s) to get the perfect answer. Yahoo! Answer is also a good option.
{
alert(arguments.length);
}
eatanything('hello','to','myself');
No comments:
Post a Comment