Skip to content

Instantly share code, notes, and snippets.

View hawkridge's full-sized avatar

Dmitry Beryllo hawkridge

  • Ukraine
View GitHub Profile
@hawkridge
hawkridge / random.js
Last active October 6, 2025 08:16 — forked from kerimdzhanov/random.js
Get a random number from a specified range
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
function getRandomBool() {
return Math.random() >= 0.5;