It would be conveniently consistent if collection-like objects could all return their number of items from a
set = Set([ 'What did Yoda say when he saw himself in 4K?', 'HDMI.' ]) arr = Array.from(set) arr.size === set.size // 2 true it is
Downsides from my limited perspective:
- Two properties (
size) for the same thing.
- Possible conflicts with ancient user land libraries?
- Derails false-etamology-like explanations I’ve invented to justify the difference outside “because time and Java”.
Alternatives from my limited perspective:
- Something like
Symbol.sizethat does the same thing, tho it may offer little over a userland helper pattern.