Feature request: Array.prototype.random

Will White w.white9 at icloud.com
Thu Jun 15 18:42:48 UTC 2017

Dear es-discuss,

I would like to propose Array.prototype.random, which would return a random array element the same way `array[Math.floor(Math.random() * array.length)]` does, because every time I want a random array element, I have to remember how to do it. Do you think this is a useful addition to the language?

Will White

More information about the es-discuss mailing list