Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
Others responded on-topic, so I would add an off-topic :)
I do not build a JS project without Lodash (or something similar), it covers the basic needs and lacks of JS, acting like a Standard library in other languages. A few of them are related to random
_.random([lower=0],[upper=1],[floating])_.sample(collection)//get a random element_.sampleSize(collection,[n=1])
But, statistically speaking, taking a float random and truncating it to just a small integer range it's like buying a Ferrari for commuting, just saying :D Most of the times is a waste of resources.
Devs should be more careful at the distributions, most of the cases the code will be used for a few values and a small range of values, which will lead to very not-so-random results.
If the random results will affect the User Experience you should think twice of using it, the screwed distribution will affect your sales and KPIs in unknown ways, most likely negative, and there are always better alternatives, that require more resources to implement of course.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Others responded on-topic, so I would add an off-topic :)
I do not build a JS project without Lodash (or something similar), it covers the basic needs and lacks of JS, acting like a Standard library in other languages. A few of them are related to random
Devs should be more careful at the distributions, most of the cases the code will be used for a few values and a small range of values, which will lead to very not-so-random results.
If the random results will affect the User Experience you should think twice of using it, the screwed distribution will affect your sales and KPIs in unknown ways, most likely negative, and there are always better alternatives, that require more resources to implement of course.