Why can't this closure be used?

encounter a problem, let go ("l") output "gol", go () ("l") output "gool", go () ("l") can output "goooool".
here is my solution

function go(r) {
    let str = "go";

    function a() {
        str += "o";
    }

    function pro(m) {
        if (m) {
            console.log(str + "l");
        } else {
            a();
            return pro;
        }
        
    }

    if (!r) {
        a();
        return pro;
    } else {
        console.log(str + "l");
    }
}

but I found that the last judgment did pro.

function go(r) {
    let str = "go";

    function a() {
        str += "o";
    }

    function pro(m) {
        if (m) {
            console.log(str + "l");
        } else {
            a();
            console.log(pro);
            return pro;
        }
        
    }
    pro(r);
    
}

if you change it like this, you will report an error.

console can get pro, want to know why thank you

Jul.09,2021

return pro (r);

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-1b3c027-4131e.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-1b3c027-4131e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?