Private
_countIncrement and get the number of times the percentage has been incremented.
Time complexity: O(1)
Space complexity: O(1)
The number of times this percentage has been incremented
const autoPercentage = new AutoPercentage();
const a = autoPercentage.count();
Number(a); // 1
const b = autoPercentage.count();
Number(a); // 2
Number(b); // 2
Increment and get the percentage.
Time complexity: O(1)
Space complexity: O(1)
The percentage
const autoPercentage = new AutoPercentage();
const a = autoPercentage.percentage();
Number(a); // 1
const b = autoPercentage.percentage();
Number(a); // 0.5
Number(b); // 0.5
A class to help with specific use-cases where you are using a percentage (ex.
1 / n
) but don't known
until runtime.Example