10 lines
210 B
JavaScript
10 lines
210 B
JavaScript
function exp(b,n)
|
|
{
|
|
var ans = 1;
|
|
for (var i =1; i <= n; i++)
|
|
{
|
|
ans = b * ans;
|
|
}
|
|
return ans;
|
|
}
|
|
console.log(exp(2, 3));
|