📦 Archived documentation: r1 (committed 2026-10-07) View current documentation →

Math.tanh()

Math.tanh(x) → number

Returns the hyperbolic tangent of x.

Returns the hyperbolic tangent of x. The result is in the range -1 to 1.

Arguments

NameTypeRequiredDefaultDescription
x number optional — A number.

Returns

number The hyperbolic tangent of x.

Example

let t = Math.tanh(1); // 0.7615941559557649