Skip to main content

add(x: any, y: any): unknown

Adds two given inputs using the built-in operator+.

remarks

The function makes no assumptions about the input types. Number casting is not performed on the augend, so operations including string concatenations will work perfectly, unlike in the safe version.

Parameters:#

NameTypeDescription
xanyThe augend.
yanyThe addend.

Returns: unknown

The result of the addition or concat.

Defined in: unsafe/math/add.ts:14

Last updated on