So I have this function that I wish to spit out some object information if there is something in it. But I am stuck. Anyone know what the problem is?
function ifExist(property) {
if ( randomObj.property === "" ) {
message += "";
} else {
message += "<span class='propString'>" + randomObj.property + "</p>";
}
return message;
}
ifExist(citation);
ifExist(year);
Thanks in forehand!