Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp core library.randomnumbergenerator

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-core-library > RandomNumberGenerator

RandomNumberGenerator class

This is the default implementation of IRandomNumberGenerator that simply calls Math.random().

Signature:

export default class RandomNumberGenerator implements IRandomNumberGenerator

Implements: IRandomNumberGenerator

Constructors

Constructor Modifiers Description
(constructor)(serviceScope) Constructs a new instance of the RandomNumberGenerator class

Properties

Property Modifiers Type Description
serviceKey static ServiceKey<IRandomNumberGenerator> The service key for IRandomNumberGenerator.

Methods

Method Modifiers Description
generate() Returns a pseudorandom number between 0 (inclusive) and 1 (exclusive), following the contract of Math.random().
Clone this wiki locally