The getCurrentStep() method returns the step of the range .
range.class.ts
public getCurrentStep(): number | undefined {
return typeof this.value === 'number'
? Math.floor(this.value / this.#step)
: undefined;
}
Return type
|
Returns
The return value is the step of type, if range is set, otherwise .
Example usage
// Example usage.
import { Method } from '@angular-package/range';
// Create new instance.
// Returns Range {min: 3, max: 27, value: 10} of Range<3, 27, 3>.
const range = new Range(3, 27, 10, 3);
// Returns 3 of number | undefined.
range.getCurrentStep();