The way that Comparable and Enumerable unlock all this functionality is such a great feature of Ruby. In JavaScript, methods like map, select, find, etc are all tied to Array, which means you can’t treat Sets, Arrays and Lists all the same. It’s so disappointing.
If taken to the next conclusion it can be somewhat annoying that if you map a Hash or other data types you get back an Array. Still doing some musing on a nice interface to fix that.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The way that Comparable and Enumerable unlock all this functionality is such a great feature of Ruby. In JavaScript, methods like map, select, find, etc are all tied to Array, which means you can’t treat Sets, Arrays and Lists all the same. It’s so disappointing.
If taken to the next conclusion it can be somewhat annoying that if you
map
aHash
or other data types you get back anArray
. Still doing some musing on a nice interface to fix that.