appendChild
removes an element from where it is (if it is anywhere) and then puts it at the end of the thing you are appending it to.
So this:
- Puts the TR at the end of the table (assuming it had been created before the loop and wasn't anywhere in the DOM already).
- Removes the TR from the end of the table, then puts it back in the same place
- Removes the TR from the end of the table, then puts it back in the same place
- Removes the TR from the end of the table, then puts it back in the same place
- Removes the TR from the end of the table, then puts it back in the same place
- Removes the TR from the end of the table, then puts it back in the same place
- Removes the TR from the end of the table, then puts it back in the same place
… and then the loop ends.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…