Back to Functions

add

math

Adds two numbers.

Installation

Import
import { add } from '@tulx/utils';

Source Code

Implementation
/**
 * Adds two numbers.
 *
 * @param augend - The first number in an addition.
 * @param addend - The second number in an addition.
 * @returns Returns the sum.
 *
 * @example
 * ```ts
 * add(6, 4); // 10
 * ```
 */
export function add(augend: number, addend: number): number {
  return augend + addend;
}

Example

import { add } from '@tulx/utils';

add(6, 4); // 10

Related Functions