DEV Community

Discussion on: Understanding Ruby - Comparable

Collapse
 
kgilpin profile image
Kevin Gilpin

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.

Collapse
 
baweaver profile image
Brandon Weaver

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.