Javascript Math cbrt()

Introduction

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

Math.cbrt(x)    // x is a number.
let a = Math.cbrt(NaN); // NaN
console.log(a);/*from  ww w.ja v a2 s  .  co m*/
Math.cbrt(-1); // -1
console.log(a);
Math.cbrt(-0); // -0
console.log(a);
Math.cbrt(-Infinity); // -Infinity
console.log(a);
Math.cbrt(0); // 0
console.log(a);
Math.cbrt(1); // 1
console.log(a);
Math.cbrt(Infinity); // Infinity
console.log(a);
Math.cbrt(null); // 0
console.log(a);
Math.cbrt(2);  // 1.2599210498948732
console.log(a);



PreviousNext

Related