Our great sponsors
-
That said, what it looks like you're doing may be done with Array.prototype.reduce where you can attempt to do you entire pipeline of operations on each element (unless they're not mutually exclusive) all in a single pass, even excluding elements that don't pass a particular filter. The reducer callback that you employ can employ other reducers, too. This sounds very similar to writing a JSON parser to me -- recursive parsing of nested hashes or other collections. I've done this in a functional language before. If you're not opposed to an abstraction, there is RamdaJS - https://ramdajs.com/. I enjoyed tinkering with it when I was still doing JavaScript, and have seen it pop up from time to time.
-
It’s harder to write more functional code without the right tools. JavaScript is okay as a functional language (better than most tbh), but is missing some key components like immutable data structures. You might checkout Immer or Immutable.js to fill this gap.
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!