@libs.arithmetic.Addition.Adder
github-actions[bot] edited this page Jan 24, 2024
·
7 revisions
@libs/arithmetic.Addition.Adder
Adds two number with a class.
• new Adder(x
): Adder
Creates an instance of Adder.
Name | Type | Description |
---|---|---|
x |
number |
The first number. |
• Readonly
x: number
The first number.
▸ add(y
): number
Adds the number to the instance number.
Name | Type | Description |
---|---|---|
y |
number |
The second number. |
number
The sum of the two numbers.
Example
// Return 2:
new Adder(1).add(1);
If you want single repo example, please go to https://github.com/rhea-so/tsdoc-github-wiki-example