When running this code, Internet Explorer throws an error ')' is expected while Firefox executes it smoothly. The console in Internet Explorer points to the first line:
function HTMLtableRows (titles=[] , values=[]) {
How can I resolve this issue?
function HTMLtableRows (titles=[] , values=[]) {
var i, j;
var str, strT, strM;
str = '<table class="table">';
str = str + '<tr>';
for (j = 0; j < titles.length; j++) {
str = str + '<th colspan="2"><center>' + titles[j] + '</center></th>';
}
str = str + '</tr>' + '<tr>';
for (j = 0; j < titles.length; j++) {
str = str + '<th>Tijdstip</th>' + '<th>Looptijd</th>';
}
str = str + '</tr>' + '<tr>';
for (j = 0; j < titles.length; j++) {
var a = values[j].split('\r');
strT = ''
strM = ''
for (i = 0; i < a.length; i++) {
var b = a[i].split('=');
if (b[1] != undefined) {
strT = strT + b[0];
strM = strM + b[1] + 'min';
}
if (i < a.length - 1) {
strT = strT + '<br>';
strM = strM + '<br>';
}
}
str = str + '<td>' + strT + '</td>';
str = str + '<td>' + strM + '</td>';
}
str = str + '</tr>';
str = str + '</table>';
return str;
}