There are more robust ways to do this. Think about if you want to modify the function later on. You are depending solely on the ordinal position of the arguments to carry out any operations. Plus, you can't check if a specific type of property is there (think about optional parameters). You can use JavaScript Object Notation to make your code more readable and maintainable:
/p>
function makeWebSite(site)
{
alert('Creating site "' + site.name + "' @ " + site.address + "...");
/p>
for(var i = 0; i < site.administrators.length; i++)
{
alert(site.administrators[i] + " has been added as user #" + (i + 1));
}
}
/p>
var newSite =
{
'name' : 'Vikram\'s Blog',
'address' : 'www.VikramLakhotia.com',
'administrators' : ['Vikram Lakhotia', 'Bill Gates']
}
/p>
makeWebSite(newSite);
/p>