The variable that stores the constructor function in JavaScript

My question might be basic but I could not really find a good explanation anywhere. I am new to JavaScript and I am confused about the variable that stores the constructor function and it's functionality, in this example, var MyObject.

The constructor function:

var MyObject = function(){
    var self ={ 
        x:250,      
        y:250
    }    
     return self; 
}

The question is, if I do something like below after the above code (outside the constructor function):

MyObject.list = {};

MyObject.connect = function(data){
 //do something
};

What exactly is the meaning of this? will it add the new method and the new list to all instances of MyObject?

Is it equivalent to writing the additional list and connect method within the constructor function itself like this:

var MyObject = function(){
        var self ={ 
            x:250,      
            y:250
        } 
        self.list = {};
        self.connect = function(data){
               //do something
        };

   return self; 
}

What is the equivalent way of achieving this behavior in Java? declaring a static variable/ method?