Yearly Pay yearly and get 2 months free on every paid plan. See plans
Sign in Start free

API doc writer

Input
Code
function add(a, b) { return a + b; }
Sample output Made on 27 October 2026

add(a, b)

Adds two values using JavaScript’s + operator.

Parameters

Name Type Constraints
a any None. If either operand is a string, string concatenation may occur.
b any None. If either operand is a string, string concatenation may occur.

Returns

any — The result of evaluating a + b.

Errors

This function does not explicitly throw errors. JavaScript may throw a TypeError for incompatible operand types, such as mixing a bigint with a number.

Example

const result = add(2, 3);

console.log(result); // 5
Use this API doc writer The form opens filled with this sample's inputs; change anything.