4 ms·
As it says in the HTML Standard[0]: >The design of `DOMParser`, as a class that needs to be constructed and then have its `parseFromString()` method called, is
by chrisoverzero 6y ago
As it says in the HTML Standard[0]:
>The design of `DOMParser`, as a class that needs to be constructed and then have its `parseFromString()` method called, is an unfortunate historical artifact. If we were designing this functionality today it would be a standalone function.
[0]: https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization https://html.spec.whatwg.org/multipage/dynamic-markup-insert...
- Tomis02 6y ago> The design of `DOMParser` ... is an unfortunate historical artifact My prediction is that in 20-30 years the same will be said about today's mainstream OOP.