Home » JavaScript Math cbrt() Method

JavaScript Math cbrt() Method

by Online Tutorials Library

JavaScript Math cbrt() method

The JavaScript math cbrt() method returns the cube root of the given number. Unlike sqrt() method, this method accepts negative number.

Syntax

The cbrt() method is represented by the following syntax:

Parameter

num – A number.

Return

The cube root of the given number.

JavaScript Math cbrt() method example

Here, we will understand cbrt() method through various examples.

Example 1

Let’s see an example to print the cube root of the given number.

Test it Now

Output:

3  -4  

Example 2

Here, you can test cbrt() method with your own test cases.

Test it Now

Next TopicJavaScript Math

You may also like