I am diving deeper into javascriptJavaScript and starting to learn more about prototypes and simulating Classesclasses etc. I am used to working with the Module pattern and would like to try and combine this pattern along with working with prototyping into aan own little framework (Purelypurely for learning purposes).
I have devised a little contructconstruct and i whasI was hoping if some of you advanced users could give me some feedback on the particular construct.
What iI am trying to achieve is to create a singleton with methods and properties one could access, iI would like to extend/build this via the prototype as speed is something iI care alota lot about. The thing iI still have doubts about is whether or not this would be a suitable construct for what iI have in mind, whether or not this would be fast etc.
Much appreciated! Here's the code.
var Mui = (function (window, document, undefined) {
Mui = function () {
this.Version = {
Major : '0',
Minor : '1',
Bugfix : '0'
};
};
Mui.prototype = {
sayHi : function () {
alert('hi');
}
};
return new Mui;
}(window, this.document));