var budgetController = (function() {
var x = 23;
var add = function(a) {
return x + a;
}
return {
publicTest: function(b) {
return add(b);
}
}
})();
var budgetController = (function() {
var x = 23;
var add = function(a) {
return x + a;
}
return {
publicTest(b) {
return add(b);
}
}
})();
I'm learning an online course about Module and Closure. I'm confused with these two style of function format. If I call budgetController.publicTest(5); Both seems work. Thank you so much!