thetrevorharmon / thetrevorharmon.com

The blog & portfolio of Trevor Harmon.
http://thetrevorharmon.com
GNU General Public License v3.0
9 stars 0 forks source link

Migrate reading list code to use lodash's `.sampleSize` #187

Closed thetrevorharmon closed 1 year ago

thetrevorharmon commented 1 year ago

Lodash has an array function called .sampleSize which lets you get n random elements from an array. It's exactly what is happening here but a single function call instead of a bunch of logic 🎉