I have a javascript array with a list of informations about people. I populate this array dynamically into a table on the frontend.
But, not every person has a website. So I want to enter a condition for the website e.g. if(url !== "") {<a href="'+ list[i].url + '">Webseite</a>}
But it just tells me "unexpected token if". Ideas?
for(var i = 0; i < list.length; ++i ) {
$(".list").append('\
<tr>\
<td>'+ list[i].name + '</td>\
<td>' + list[i].area1 + ',<br> ' + list[i].area2 + ',<br> ' + list[i].area3 + '</td>\
<td>'+ list[i].small_area + '</td>\
<td>'+ list[i].studies + '</td>\
<td>'+ list[i].email + '</td>\
<td><a href="'+ list[i].url + '">Webseite</a></td>\
<td>'+ list[i].other + '</td>\
</tr>\
');
};