var tmu, categories = [['Morning','am'],['Evening','pm']],
days = ['mon', 'tue', 'wen', 'thu', 'fri', 'sat', 'sun'],
fullDay, i;
tmu += '<table>';
categories.forEach(function(ele){
tmu += '<tr id="periodTitle">';
tmu += '<td colspan=7 style="text-align:center;">'+ele[0]+'</td>';
tmu += '</tr>';
for(i = 0; i <= 6; i++){
tmu += '<td id="'+days[i]+'-'+ele[1]+'">x</td>';
}
});
tmu += "</table>";
console.log(tmu);
I am trying to write some code to loop through some table creation however it keeps adding an undefined text to the beginning of the loop and I'm not sure why, everything else works great. Any ideas on how this could happen?
The fiddle link is here. Thanks for any help in advance!!