Looks like you want to reveal your methods by attaching them to the argument, not by returning them. Use
(function(Pbr) {
Pbr.ShowHomePage = function() {
console.log("ShowHomePage called")
}
function privateFunc() {
console.log("Showtitle");
}
Pbr.ShowTitle = privateFunc; // not very private, btw
}(Pbr = Pbr || {}));
If you want to return
an object literal, you will need to assign the result of the IEFE, and overwrite existing Pbr
values. It would look like
var Pbr = (function() {
function privateFunc() {
console.log("Showtitle");
}
return {
ShowTitle: privateFunc
ShowHomePage: function() {
console.log("ShowHomePage called")
}
}
}());