GitHub 6248★

Generate a random floating point number in given range

JavaScript version

const randomFloat = (min, max) => Math.random() * (max - min) + min;

TypeScript version

const randomFloat = (min: number, max: number): number => Math.random() * (max - min) + min;
Follow me on and to get more useful contents.