Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDevCommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

OCP App SDK / NumberSet

NumberSet

A node Set of only numbers.
Used to differentiate between a string set or a number set as stored in the key-value storage.

Hierarchy

  • Set<number>.NumberSet

Index

Constructors

Properties

Methods

Constructors

constructor()

Signature

new NumberSet(values?: null | readonly number[]): NumberSet;

Parameters

NameType
values?null | readonly number[]

Returns

NumberSet

Inherited from: Set<number>.constructor

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:119

Signature

new NumberSet(iterable?: null | Iterable<number>): NumberSet;

Parameters

NameType
iterable?null | Iterable<number>

Returns

NumberSet

Inherited from: Set<number>.constructor

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:209

Properties

[toStringTag]

Readonly string

Inherited from: Set.[toStringTag]

Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:143

size

Readonly number

Inherited from: Set.size

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:115

[species]

Static Readonly SetConstructor

Inherited from: Set.[species]

Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:320

Methods

Iterates over values in the set.

Signature

iterator: IterableIterator<number>;

Returns

IterableIterator<number>

Inherited from: Set.[iterator]

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:172

add()

Appends a new element with a specified value to the end of the Set.

Signature

add(value: number): NumberSet;

Parameters

NameType
valuenumber

Returns

NumberSet

Inherited from: Set.add

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:96

clear()

Signature

clear(): void;

Returns

void

Inherited from: Set.clear

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:98

delete()

Removes a specified value from the Set.

Signature

delete(value: number): boolean;

Parameters

NameType
valuenumber

Returns

boolean

Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

Inherited from: Set.delete

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:103

entries()

Returns an iterable of [v,v] pairs for every value v in the set.

Signature

entries(): IterableIterator<[number, number]>;

Returns

IterableIterator<[number, number]>

Inherited from: Set.entries

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:176

forEach()

Executes a provided function once per each value in the Set object, in insertion order.

Signature

forEach(callbackfn: Function, thisArg?: any): void;

Parameters

NameType
callbackfn(value: number, value2: number, set: Set<number>) => void
thisArg?any

Returns

void

Inherited from: Set.forEach

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:107

has()

Signature

has(value: number): boolean;

Parameters

NameType
valuenumber

Returns

boolean

a boolean indicating whether an element with the specified value exists in the Set or not.

Inherited from: Set.has

Defined in: node_modules/typescript/lib/lib.es2015.collection.d.ts:111

keys()

Despite its name, returns an iterable of the values in the set.

Signature

keys(): IterableIterator<number>;

Returns

IterableIterator<number>

Inherited from: Set.keys

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:180

values()

Returns an iterable of values in the set.

Signature

values(): IterableIterator<number>;

Returns

IterableIterator<number>

Inherited from: Set.values

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:185