3 ms·
Ah, you're actually answering my question from above. I was wondering if there was a way to emulate the behaviour I've gotten accustomed to in Ruby vis à vis `E
by VeejayRampay 10y ago
Ah, you're actually answering my question from above. I was wondering if there was a way to emulate the behaviour I've gotten accustomed to in Ruby vis à vis `Enumerable#each` where the (key, value) are yielded to the block passed to each. It doesn't seem to be possible to do that with object literals in JS, but you mention that Map would do (and it actually does, see [1]). Nice.
[1] https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map#Iterating_Maps_with_for..of https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...