Doing Math

ES6 adds a lot of new methods to the Math object, related to trigonometry, arithmetic, and miscellaneous. This lets the developers use native methods instead of external math libraries. Native methods are optimized for performance, and have better decimal precision.

Trigonometry related operations

Here is an example code, which shows the entire trigonometry-related methods that are added to the Math object:

 console.log(Math.sinh(0)); //hyberbolic sine of a value console.log(Math.cosh(0)); //hyberbolic cosine of a value console.log(Math.tanh(0)); //hyberbolic tangent of a value console.log(Math.asinh(0)); //inverse hyperbolic sine of a value console.log(Math.acosh(1)); //inverse hyperbolic cosine of a value console.log(Math.atanh(0)); ...

Get React: Building Modern Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.