On one side, If I open the browser console and execute
document.write("Hi"); a new document will appear on the same browser window, so a new document was created with that language construct (whether if the previous document was deleted or whether if it still exists somewhere).
On the other side, if I open the browser console and execute:
newHTML = document.querySelector("body"); newHTML.innerHTML +=` <div>Hi</div> `;
a new document with that data will be created but it will be merged into the previous document so the end result would be that the previous document still appears generally regularly in the same browser window but just with the slight change (HTML being appended in this case) from the new document back to the that original one.
A new document by document.write() is explicit but a new document by innerHTML is implicit, why?