Skip to content

Calculator.CalculatorFactory

github-actions[bot] edited this page Jan 24, 2024 · 2 revisions

Class: CalculatorFactory

Calculator.CalculatorFactory

A factory for creating calculators.

Table of contents

Constructors

Methods

Constructors

constructor

new CalculatorFactory(): CalculatorFactory

Returns

CalculatorFactory

Methods

create

create(value?): Calculator

Creates a new calculator.

Parameters

Name Type Default value Description
value number 0 The initial value of the calculator.

Returns

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

Defined in

calculator/factory/calculator-factory.ts:25

TSDoc GitHub Wiki Example

Namespaces

Clone this wiki locally