Skip to main content

getValue()

returns the current value of Slider

getValue(): number[];

Returns:

An array with the current value of the slider.

Example

const value = slider.getValue(); // -> [20]

// for a range slider as an array
const value = slider.getValue(); // -> [20,50]

Related sample: Slider. Get value

note

In case you've set the value of Slider (via setValue()) as an array where the first number is greater than the second one, e.g. [50,20], getValue() will return the value as an array with numbers in the ascending order, that is [20,50].