This is a placeholder to discuss the misconceptions regarding the JavaScript programming language, the DOM, and Web API interfaces present in the browser environment. These are distinct and this is not always a clear distinction. I think that some of the quirks and inconsistencies blamed on JavaScript are the result of the browser API implementation.
The DOM refers to Document Object Model. This consists of the unit elements and their rules for display in the web browser.
The DOM further consists of a series of APIs - Application Programming Interfaces - which expose the DOM and its consistent elements to manipulation.
It is best to imagine a web page as consisting of a root element and sub elements. In the browser the root element is the Window object. Within the window object there are a series of objects and methods which allow the DOM to be manipulated.
The language of the web is JavaScript. The web browser loads the web page and there are 3 languages used to display and manipulate the contents of the web page. The web page is a program which runs within the browser’s environment. The browser is a program which runs on your computing device whether it be a laptop, desktop, or mobile device.
A further major element is that there are various browser programs created by a variety of manufacturers which run in an increasing number of devices. Today the major browser manufacturers are Google (Chrome), Mozilla (Firefox), Apple (Safari), and Microsoft (Edge, Internet Explorer). Together these manufacturers account for probably (check this) 98% or more of the browser market.
The browsers are built according to standards created by third parties. These standards are continuously evolving as the technology for delivering web content also evolves and improves.
The implementation of the third party standards varies among the browser manufacturers, so there are some features which may be supported in one browser and not in others. In some cases features may enjoy partial support. It is up to the browser manufacturer to implement various features and when to implement them.
This variety among browsers and devices complicates the job of people who build websites. The web developer must balance the application of new and exciting features with their support. Care must be taken to allow targeted uses to access the content regardless of their choice of browser or device.