Difference between Browser JavaScript and Node.js

Node.js does not have:
- When working on Node.js you have no access to browser APIs(like DOM, fetch, etc).
- Because we build serverside apps with node.
- Node apps will have pure logic without the graphical interface.
Node.js does have:
- Access to filesystem. Info about the operating system, etc.
- It is based on versions. So, unlike browser apps which depends on users browser, our node app runs only in the node js version it was built on.
- Unlike in browser where modules are optional, in Node.js you have access to modules by default.
- Under the hood Node.js uses commonJS for libraries.
Example: In terminal

Exmaple: In js file

