-
Notifications
You must be signed in to change notification settings - Fork 0
Calculator.CalculatorFactory
github-actions[bot] edited this page Jan 24, 2024
·
2 revisions
Calculator.CalculatorFactory
A factory for creating calculators.
• new CalculatorFactory(): CalculatorFactory
▸ create(value?
): Calculator
Creates a new calculator.
Name | Type | Default value | Description |
---|---|---|---|
value |
number |
0 |
The initial value of the calculator. |
A new calculator.
Static
Example
const calc = CalculatorFactory.create();
console.log(calc.value); // 0
Example
const calc = CalculatorFactory.create(1);
console.log(calc.value); // 1