random

v2.1.1arrow_drop_down
v2.1.1
v2.1.0
v2.0.9
v2.0.8
v2.0.6
v2.0.5
v2.0.1
v1.1.1
v1.1.0
v1.0.8
v1.0.5
v1.0.4
v1.0.3
STATUS
Passing
DOWNLOADS
1,470
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
518 B
random number between 0 and 1, or between 0 and max parameter(optional)
1 contributor
Install random as a package?
Copied
npm i @bit/joshk.jotils.random
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
No preview available
modifieddraft
chevron_left
chevron_right
random (
max:number
) : number

random number between 0 and 1, or between 0 and max parameter(optional)

Examples
import { random } from '@bit/joshk.jotils.random'
export default random() // => 0.123
import { random } from '@bit/joshk.jotils.random'
export default random(1, 10) // => 7
Argument
max: number

max parameter(optional)

Returns
number

random number

Test Summary

random return random number between 0 and 1

Pass

random return random number between 0 and max parameter

Pass
Help and resources