Skip to content

Instantly share code, notes, and snippets.

Brian Hayes joeyred

Block or report user

Report or block joeyred

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kerimdzhanov
kerimdzhanov / random.js
Last active Nov 14, 2019
JavaScript: get a random number from a specific range
View random.js
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
You can’t perform that action at this time.