http://jsfiddle.net/LU3pE/
I want the function to make the arguments into a single string and return it. What have I done incorrectly?
function cooncc(divider, lastdiv){
var returner;
for (var i = 0; i < (arguments.length - 2); i++)
{
returner += arguments[i+2] + divider;
}
returner -= divider;
returner += lastdiv + arguments[arguments.length - 1];
return divider;
}
var output = cooncc(", ", ", and ", "Andy", "Becky", "Caitlin", "Dave", "Erica", "Fergus", "Gaby");
document.body.innerHTML = "<h1>" + output + ".</h1>";