Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/number/index.ts>random

A JavaScript extension package for building strong and modern applications.
Latest
function random
import { random } from "https://deno.land/x/ayonli_jsext@v0.9.72/number/index.ts";

Returns a random integer ranged from min to max (inclusive).

Examples

Example 1

import { random } from "@ayonli/jsext/number";

console.log(random(1, 5)); // 1, 2, 3, 4, or 5

Parameters

min: number
max: number

Returns

number