Using Math cbrt() function to coding in Javascript/JS

This JavaScript tutorial explains how to use the math feature referred to as cbrt() with syntax and examples.


In JavaScript, cbrt() is a function that is used to return the dice root of a number. Because the cbrt() feature is a static function of the Math object, it need to be invoked through the placeholder object known as Math.


In JavaScript, the syntax for the cbrt() feature is:


Parameters or Arguments

number The number used to calculate the cube root.


The cbrt() feature returns the cube root of a number.


Math is a placeholder object that contains mathematical features and constants of which cbrt() is one of these functions.


Let’s take a seem to be at an example of how to use the cbrt() feature in JavaScript.

For example:


In this example, we have invoked the cbrt() characteristic using the Math class.

We have written the output of the cbrt() characteristic to the web browser console log, for demonstration purposes, to exhibit what the cbrt() characteristic returns.

The following will be output to the net browser console log:


In this example, the first output to the console log again 2 which is the cube root of eight (because two x two x 2 = 8).

The second output to the console log lower back 3 which is the cube root of 27 (because 3 x three x three = 27).

The 0.33 output to the console log returned 10 which is the cube root of 1000 (because 10 x 10 x 10 = 1000).