4 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

4

15. Write a JavaScript function to compute the value of bn where n is the exponent and b is the bases. Accept b and n from the user and display the result.

11th Dec 2016, 7:59 PM
Nashwan Aziz
Nashwan Aziz - avatar
1 Answer
+ 2
Try this : window.onload = function main() { var x = prompt("Input base") ; var y = prompt("Input exponent") ; alert(Math.pow(x,y)) }
16th Dec 2016, 8:42 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar