So, I have an if statement that filters out null objects and it's working fine. However, when I try to insert something in join() like join("li"), all null objects are displayed on the page as shown in the image. I just want to display objects that are not null, but when I tried another join("\n"), it didn't work as expected.
https://i.sstatic.net/12PuM.png
var vitalTest = document.getElementById("vitalComments").value
= systemList[0].comments.join("");
//alert(vitalTest);
if (vitalTest == ""){
}else{
document.getElementById("vitalComments").innerHTML = systemList[0].comments.join("<li>");
var vitalTitleq = document.getElementById("vitalTitle").innerHTML
= systemList[0].systemName;
}