Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Raise a Number to a Certain Power</title> </head> <body> <script> document.write(Math.pow(3, 2) + "<br>"); // Prints: 9 document.write(Math.pow(0, 1) + "<br>"); // Prints: 0 document.write(Math.pow(5, -2) + "<br>"); // Prints: 0.04 document.write(Math.pow(16, 0.5) + "<br>"); // Prints: 4 (square root of 4) document.write(Math.pow(8, 1/3)); // Prints: 2 (cube root of 8) </script> </body> </html>