+ 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. .
4 Respostas
+ 2
think of using loop.
multiply b with itself n times.
try it code urself , then only u will learn😃
+ 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.
+ 1
ansuer with javascript al please
+ 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");