4 ms·
And this is why JavaScript is one of my least favorite languages. Is there a website that stays up-to-date with a brief summary of all this nonsense? I haven'
by Xcelerate 9y ago
And this is why JavaScript is one of my least favorite languages.
Is there a website that stays up-to-date with a brief summary of all this nonsense? I haven't programmed in JavaScript in 4 years but am needing to relearn it again for a project, and searching Google for "iterating over elements" in JavaScript returns 57 different techniques, all considered "the best way" at some different point in time over the last few years, and all with varying levels of browser support.
Looping/filtering over things should just not be this convoluted of a process...
- shortstuffsushi 9y agoI think that the Mozilla Dev docs would probably be useful to you, or at least that's what I always end up going to -- https://developer.mozilla.org/en-US/ https://developer.mozilla.org/en-US/
- thibautg 9y agoIt makes sense because the DOM is like a huge global, mutable variable. Map and reduce are used in functional programming to create a new immutable variable. forEach allows to mutate each node from the nodeList.