Good day,
I was confused on how am I be able to add an If statement inside my loop when appending strings.
heres my code
html += '<tr><td></td>'+
'<td>'+moment(x.date_at).format('MM/DD/YYYY') +'</td>'+
'<td>'+x.transactionType+'</td>'+
'<td>'+x.id+'</td>'+
'<td>'+if(x.description!=null){x.description}+'</td>'+
'<td>'+x.ref_no+'</td>'+
'<td class="align-right">'+x.debit+'</td>'+
'<td class="align-right">'+x.credit+'</td>'+
'<td class="align-right">'+val+'</td></tr>';
});
I am then getting a syntax error error on the IF part. Thanks for the help. its been a while since I code thats why im a bit confused.