Simply add another immediately invoked function expression within the function, and pass an assignment argument to it so that it's initialised.
(function (skillet, $, undefined) {
//Private Property
var isHot = true;
//Public Property
skillet.ingredient = "Bacon Strips";
//Public Method
skillet.fry = function () {
var oliveOil;
addItem("\t\n Butter \n\t");
addItem(oliveOil);
console.log("Frying " + skillet.ingredient);
};
(function (module) {
module.test = function () { // access this by typing skillet.module1.test()
if (isHot !== undefined) console.log(pour('water') + (isHot ? ', cold!' : ', hot!'));
}
function pour(what) {
return 'Pouring ' + what;
}
)(skillet.module1 || (skillet.module1 = {})); // no need for undefined and $ rewriting as already done in parent function
//Private Method
function addItem(item) {
if (item !== undefined) console.log("Adding " + $.trim(item));
}
}(window.skillet || (window.skillet = {}), jQuery));