Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten.Erfahre mehr über dieses Experiment.
Math.cosh()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
DieMath.cosh() statische Methode gibt den hyperbolischen Kosinus einer Zahl zurück. Das heißt,
In diesem Artikel
Probieren Sie es aus
console.log(Math.cosh(0));// Expected output: 1console.log(Math.cosh(1));// Expected output: 1.543080634815244 (approximately)console.log(Math.cosh(-1));// Expected output: 1.543080634815244 (approximately)console.log(Math.cosh(2));// Expected output: 3.7621956910836314Syntax
js
Math.cosh(x)Parameter
xEine Zahl.
Rückgabewert
Der hyperbolische Kosinus vonx.
Beschreibung
Dacosh() eine statische Methode vonMath ist, wird sie immer alsMath.cosh() verwendet und nicht als Methode eines erstelltenMath-Objekts (Math ist kein Konstruktor).
Beispiele
>Verwendung von Math.cosh()
js
Math.cosh(-Infinity); // InfinityMath.cosh(-1); // 1.5430806348152437Math.cosh(-0); // 1Math.cosh(0); // 1Math.cosh(1); // 1.5430806348152437Math.cosh(Infinity); // InfinitySpezifikationen
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-math.cosh> |