|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
638 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | /**
|
|---|
| 2 | * Adds two numbers while safely handling `NaN` values.
|
|---|
| 3 | *
|
|---|
| 4 | * This function takes two numbers and returns their sum. If either of the numbers is `NaN`,
|
|---|
| 5 | * the function returns `NaN`.
|
|---|
| 6 | *
|
|---|
| 7 | * @param {number} value - The first number to add.
|
|---|
| 8 | * @param {number} other - The second number to add.
|
|---|
| 9 | * @returns {number} The sum of the two numbers, or `NaN` if any input is `NaN`.
|
|---|
| 10 | *
|
|---|
| 11 | * @example
|
|---|
| 12 | * const result1 = add(2, 3); // result1 will be 5
|
|---|
| 13 | * const result2 = add(5, NaN); // result2 will be NaN
|
|---|
| 14 | * const result3 = add(NaN, 10); // result3 will be NaN
|
|---|
| 15 | */
|
|---|
| 16 | declare function add(value: number, other: number): number;
|
|---|
| 17 |
|
|---|
| 18 | export { add };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.