I have two variables in a jquery code and if item.a not exist, it outputs a 'null' so i want to check if the variable exists. Here's the code:
.append( "<a>" + item.a + ", " + item.b + "</a>" )
If there is no "item.a" it results in
null, Blabla
I tried this if / else statement but it returns nothing
.append( "<a>" + (item.a) ? item.a : + ", " + item.b + "</a>" )
Any idea?