ES6 - math cbrt() Function
This method returns the cube root of a number.
Syntax
Math.cbrt ( x );
Parameter
- x − represents a number
Return Value
Returns the cube root of the number.
Example
console.log("---Math.cbrt()---")
console.log("Math.cbrt(27) : "+Math.cbrt(27))
console.log("Math.cbrt(22) : "+Math.cbrt(22))
Output
---Math.cbrt()--- Math.cbrt(27) : 3 Math.cbrt(22) : 2.802039330655387
Advertisements