math root 10 js code example Example: javascript nth root var root = 3; var number = 27; var answer = Math.pow(number, 1 / root); // 3