just check if the parent node has child nodes. if yes, invoke the action. else not
var Myholder = document.getElementById("holder");
if(Myholder.hasChildNodes()) {
Myholder.removeChild(Myholder.childNodes[0]);
}
documentation : Node.hasChildNodes()