jashkenas / underscore

JavaScript's utility _ belt
https://underscorejs.org
MIT License
27.33k stars 5.53k forks source link

Properly convert _.sample input collection to array #2944

Closed jgonggrijp closed 2 years ago

jgonggrijp commented 2 years ago

This fixes #2927, a regression that resulted from #2158. The change is trivial and obvious: _.toArray is our single trusted way to reliably produce arrays from values.

I'm not expecting a review (although reviews are welcome); this pull request is just to leave a trace.