Code write return return parameter program does not work properly, delete return and write alert directly.
<body>
<script>
function power(base,exponent){
if(exponent == undefined){
exponent = 2;
}
var result = 1;
for(var count = 0;count<exponent;countPP){
result = result *base;
}
//return result;
alert(result);
}
</script>
<button onclick="power(4)"></button>
</body>
if you choose to use return, how to write the pop-up result if you want to click the button below, try many methods without success, thank you!