A long-standing issue with MDN is that it misleadingly uses static property and method syntax for instance properties and methods.
For example, there is an article titled SharedWorkerGlobalScope.close(), but if you type SharedWorkerGlobalScope.close
in your console, it will print undefined
. There is no close()
static method on the SharedWorkerGlobalScope
class. What this article is really referring to is the prototype method, SharedWorkerGlobalScope.prototype.close()
.
I could give hundreds of examples like this. A few, which I am not allowed to link to given the limitations on new users of this forum: WebSocket.protocol
, Storage.setItem()
(but localStorage.getItem()
), Window.sessionStorage
(but window.localStorage
)…
This mistake isn’t universal. For example, the Array.prototype.forEach() article is correctly titled.
Is there a way we could en-masse fix all these incorrect article titles? And ideally any other cases where this incorrect syntax is used, e.g. in the body text. It would also be good to create some sort of style guide or policy to avoid this mistake from being repeated in the future.
As context, we are working on adding links from the HTML Standard to MDN. However, as one of the HTML Standard editors, I am not comfortable referring our readers to MDN given that MDN has such drastically misleading information prominently displayed in these articles’ titles.