Nodejs NodeList Remove removeHTMLCollection.prototype.remove = ()

Here you can find the source of removeHTMLCollection.prototype.remove = ()

Method Source Code

// NodeList//from   w w w  . ja v  a 2 s  .c om
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
    for(var i = this.length - 1; i >= 0; i--) {
        if(this[i] && this[i].parentElement) {
            this[i].parentElement.removeChild(this[i]);
        }
    }
};

Related

  1. remove()
    NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
      for(var i = 0, len = this.length; i < len; i++) {
        if(this[i] && this[i].parentElement) {
          this[i].parentElement.removeChild(this[i]);