add

math

Adds two numbers.

Signature

add(augend: number, addend: number): number

Parameters

NameTypeDescription
augendnumberThe first number in an addition
addendnumberThe second number in an addition

Returns

number - Returns the total

Examples

Basic usage

import { add } from 'dashlite'

const result = add(6, 4)
console.log(result)

Output:

10

Negative numbers

import { add } from 'dashlite'

const result = add(-5, 3)
console.log(result)

Output:

-2

Available since version 1.0.0