+ 4
it's because node.js doesn't run in browser like js. there is no document object to call methods from.
13th Feb 2022, 8:17 AM
Bahha┣
Bahha┣ - avatar
+ 4
Yubraj Because document is not an object of Node JS instead use console.log
13th Feb 2022, 8:24 AM
AÍąJ
AÍąJ - avatar
+ 2
document is an object referring to the html side of code, node js doesn't rely on a browser therefore document is not defined and any if it's methods would not work
13th Feb 2022, 6:09 PM
Muhammad Abouraya
Muhammad Abouraya - avatar