Rand

Enter stohastic values into your code

Introduction

Rand is a DEX8 helper for generating random numbers, shuffle array elements etc.
It can be useful for determining random time intervals so that every new crawling iteration has a new time delay.

Class "Rand"

new Rand()

const { Rand } = require('dex8-sdk');
const rand = new Rand();

Methods

integerBetween(min, max)

Generates a random integer number between min and max.
integerBetween(3000, 5000)

floatBetween(min, max, dec)

Generate a random float number between min and max with dec decimal places.
floatBetween(5.001, 8.005, 3)

shuffleArray(arr)

Mix array arr elements.
shuffleArray([34, 'some thing', true, 'bezveze'])