Create robust functions

To define a function that can accept arbitrary number of parameters in
JavaScript, invoke the arguments array within the function. This special array
contains all of the parameters passed into it. Here's an example of such a
function:

function myfriends(){
for (i=0; i<arguments.length; i++)
alert(arguments[i])
}

The above function will alert any number of people's names passed into it. As
you can see, you can probe the total number of names (parameters) by examining
arguments.length, while to access a particular name, pass into arguments the
name's index number (1 being the first name, 2 being the second etc). Finally,
notice how a robust function doesn't contain any explicit parameters when you're
defining it, for obvious reasons.

Here are a couple of examples of the above function in use:

myfriends("John", Mary") //alerts John and Mary
myfriends("Bill, David", Kelly") //alerts Bill, David, and Kelly