Are objects preferrable to arrays?

I suppose an array would be even better for a structure like that as you could use its prototype’s methods such as .push() to easily add a new rule/action set, iterate over them with callback functions using .forEach() etc. etc. Arrays per se are certainly not inferior to objects – in fact, they are high-level objects themselves with some additional tools on board.

1 Like