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
You could use
Math.nthroot = function(x,n) { //if x is negative function returns NaN return this.exp((1/n)*this.log(x)); } //call using Math.nthroot();