If the code above was executed in a NodeJS environment, we can expect the following error:
ReferenceError: document is not defined
This is because the document object does not exist in NodeJS. Like the document object, the browser’s window object also does not exist in NodeJS.
fs is not defined error if you try to use it.