Can static private variables in JavaScript be written in constructors instead of in private scopes?

(function(){
    var privateVar = 10;
    function privateFun = function(){
        return false;
    }
    MyObject = function(){    
    };
    MyObject.prototype.publicMethod = function(){
        privateVarPP;
        return privateFun();
    }
})();
Can I write

in this way?

function MyObject(){
    var privateVar = 10;
    function privateFun = function(){
        return false;
    }
    MyObject.prototype.publicMethod = function(){
        privateVarPP;
        return privateFun();
    }
}

I mean, there seems to be no difference between the two writing methods, both for code reuse and for private variables to be shared by instances.

Jan.27,2022
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-1b3bc35-e80c.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-1b3bc35-e80c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?