This seems like a simple question, but I don't know the correct syntax to make it work.
I have this code that's used by DataTables to generate a table:
'<td>'+d.expirationDate+'</td>'+
'<td>'+d.dateReceived+'</td>'+
I'd like to add a qualifier onto this that if the date field is not set, to display nothing instead of the word null.
So I tried this:
'<td class="dropInfo">'+
if (d.debitExpDate !== 'null') {
d.expirationDate
}
+'</td>'+
but I get an error. Uncaught SyntaxError: Unexpected token if
What's the correct syntax for this?