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

1

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, 6:40 PM
Nashwan Aziz
Nashwan Aziz - avatar
4 Answers
+ 2
think of using loop. multiply b with itself n times. try it code urself , then only u will learn😃
11th Dec 2016, 6:58 PM
manish rawat
manish rawat - avatar
+ 1
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:55 PM
Nashwan Aziz
Nashwan Aziz - avatar
+ 1
ansuer with javascript al please
12th Dec 2016, 6:51 PM
Nashwan Aziz
Nashwan Aziz - avatar
+ 1
function exponent (b, n) { return Math.pow(b, n); } JS has no input. You'll have to read value from DOM like var b = document.getElementById("base"); var n = document.getElementById("exp");
12th Dec 2016, 7:01 PM
Rishi Anand
Rishi Anand - avatar