Home >>JavaScript Math Reference >JavaScript cbrt() Method
JavaScript cbrt() method is used to return the cubic root of a given input number. It accepts only a single parameter which is the number whose cube root is to be found.
Syntax:Math.cbrt(x)
Parameter | Description |
---|---|
x | This is a required parameter. It defines the given input number. |
Method | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
cbrt() | 38 | 12 | 25 | 8 | 25 |
<html> <body> <p>Click the button to see the Output:</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = Math.cbrt(27); } </script> </body> </html>
Click the button to see the Output:
<html> <body> <p>Click the button to see the Output:</p> <button onclick="myFunction1()">Try it</button> <p id="demo1"></p> <script> function myFunction1() { document.getElementById("demo1").innerHTML = Math.cbrt(216); } </script> </body> </html>
Click the button to see the Output: