var MyObject = function() {
var _obj = {}
var privateVariable = 'foo'
var privateMethod = function(){}
_obj.publicVariable = 'bar'
_obj.publicMethod = function(){}
return _obj
}()
To me, it makes the separation of public and private methods and variables easier to observe.Also, an unrelated note: I've stopped using semicolons round about 6 months ago and have never looked back. It makes my life simpler, I'm happier, and my sex life has never been better.
EDIT: Removed syntax error (the "var" in front of "_obj.whatever")