<script>
var DED = function() {
var pvar=3;
function private_method() {
// do stuff here
pvar = 5;
}
return {
method_1 : function() {
// do stuff here
private_method();
alert(pvar);
pvar = 6;
},
method_2 : function() {
// do stuff here
alert(pvar);
}
};
}();
DED.method_1();
DED.method_2();
</script>