Be consistent with use of values()
for collections
#248
Labels
cleanup
This doesn't seem right, refactor, etc
library
For libraries
linkedin-tool
For the LinkedIn Tool userscript
The primary collections,
Array
,Set
, andMap
, all support iterating on the instance:Unfortunately, the default iterator for
Map
is[key, value]
, as provided by the entries() method, while for bothArray
andSet
, it is values().Due to this inconsistency, it may make sense to always explicitly use the values() method.
But, such a policy would mean that every loop over an array would be a bit noisier with that method call, and it is a pretty common thing.
And there are also the DOM array-like objects
NodeList
, et al.The text was updated successfully, but these errors were encountered: