Static & Private Class Fields
What does making PRECISION private achieve?
class MathUtils {
static #PRECISION = 2;
static setRoundingPrecision(precision) {
if (precision < 0 || precision > 20) {
throw new Error('Invalid precision');
}
this.#PRECISION = precision;
}
static round(value) {
return Number(value.toFixed(this.#PRECISION));
}
}