I searched it on the internet and it says
JavaScript is a simple programming language built into Netscape 2.0 and greater. ... Since the JavaScript interpreter is part of Netscape, it is platform-independent
But if JavaScript platform independent, why does some functionalities work on one browser, but not on the other. It is many times mentioned in the documentation also that this works in the following browser.
JavaScript is realization of the EcmaScript specification.
JavaScript in different browsers has different engines, i.e. implementations. Server-side JavaScript runs on modified Chrome's engine.
What you talking about is the APIs. Filesystem API is NodeJS-specific, DOM-api is specific to browsers. Even
console.logis not the part of JavaScript spec, but part of the implementation :)Also there is an implementations for IoT
So I think we can say that JS is platform independent.