I\'m trying to get the nth root of a number using JavaScript, but I don\'t see a way to do it using the built in Math object. Am I overlooking something? If
Math
The nth root of x is the same as x to the power of 1/n. You can simply use Math.pow:
n
x
1/n
Math.pow
var original = 1000; var fourthRoot = Math.pow(original, 1/4); original == Math.pow(fourthRoot, 4); // (ignoring floating-point error)