// Function as a model
// A Module Pattern
var singleton = (function () {
var privateVariable;
function privateFunction(x) {
// private variable
}
return {
firstMethod: function (a, b) {
// privateVariable
},
secondMethod: function (c) {
// privateFunction
}
};
}());
No comments:
Post a Comment