Im printing out items in an array in an HTML list:
"use strict";
var giftArray = ["kettle", "iron", "bed", "tv", "lamp"];
var gifts = function() {
var values= [];
for (var i = 0; i < giftArray.length; i++) {
values.push("<li>" + giftArray[i] + "</li>");
}
document.write("<ul>" + values + "</ul>");
}
gifts();
Its working except that it includes a comma after each result. Why is this happening and how can I stop it?