3 ms·
A DOM is a huge hierarchical data structure and not much else (sure, it has function pointers too, but that's pretty much it). You can easily turn things into
by necovek 6y ago
A DOM is a huge hierarchical data structure and not much else (sure, it has function pointers too, but that's pretty much it).
You can easily turn things into substructures and have functions only work on those: whether you pass by reference or value is up to you and your choice of language, but even when passing by reference (to avoid memory copying), you can write functional code.
Again, it sure is non-idiomatic for most languages, but that does not mean it's impossible or even hard.
As far as "absolutism", generally, aiming for minimal statefulness will help you write more maintainable code (citation missing :).