📜  删除索引节点列表js之间的节点 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:18.411000             🧑  作者: Mango

代码示例1
function deleteNodesBetween(nodeList, startValue, endValue) {
    for (let actualValue = endValue - 1; actualValue >= startValue; actualValue -= 1) {
        nodeList.item(actualValue).remove();
    }
}
//deletes nodes from startValue to endValue
//starts from the end value because starting from the 
//start value would cause some error with value position changing