Consider the following snippet:
var cites = document.getElementsByTagName('cite');
console.log(cites.length);
cites[0].outerHTML = "[" + cites[0].innerText + "]";
console.log(cites.length);
<cite>ASDF</cite>
<cite>FDSA</cite>
The two console.log calls print different values (2 and 1 respectively), because the first element of the array gets removed from the array when assigning to its outerHTML property. Why is this?