Math.sinh()
Math.sinh() 静态方法返回一个数字的双曲正弦。即:
试一试
console.log(Math.sinh(0));
// Expected output: 0
console.log(Math.sinh(1));
// Expected output: 1.1752011936438014
console.log(Math.sinh(-1));
// Expected output: -1.1752011936438014
console.log(Math.sinh(2));
// Expected output: 3.626860407847019
语法
js
Math.sinh(x)
参数
x-
一个数字。
返回值
x 的双曲正弦。
描述
因为 sinh() 是 Math 的静态方法,所以您总是使用 Math.sinh() 的方式来调用它,而不是通过您创建的 Math 对象的方法来调用(Math 不是构造函数)。
示例
使用 Math.sinh()
js
Math.sinh(-Infinity); // -Infinity
Math.sinh(-0); // -0
Math.sinh(0); // 0
Math.sinh(1); // 1.1752011936438014
Math.sinh(Infinity); // Infinity
规范
| 规范 |
|---|
| ECMAScript® 2026 语言规范 # sec-math.sinh |
浏览器兼容性
加载中…