I have been teaching myself to program for about a month now, and I recently ran into the JavaScript function document.write()
. I have heard many say that it is bad practice to use it, mostly because, when used incorrectly, it can overwrite the entire page. However, would it still be dangerous to use it if overwriting the entire page is the intended outcome? It seems as though I am the only one who is doing this, so I am not sure if it is some revolutionary concept, or if it is an unquestionably bad idea. I fear that it is most likely the latter.
If it helps at all, the main example that I am using this on is a Choose Your Own Adventure game that I am writing with my brother, in which I do not wish the previous decisions to continue being displayed to the player.