UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

18 lines (13 loc) 384 B
'use strict'; /*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ // src/getRandomIntInclusive.ts function getRandomIntInclusive(min, max) { const _min = Math.ceil(min); const _max = Math.floor(max); return Math.floor(Math.random() * (_max - _min + 1) + _min); } exports.getRandomIntInclusive = getRandomIntInclusive;