The use of return and alert

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!

Oct.15,2021

<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="alert(power(4))"></button>


</body>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31de1-2b316.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31de1-2b316.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?