I am very new for understanding the javascript object oriented development. So I am reading jQuery source code and trying to understand by implementing the same concept to my custom libs although goal is not copy code but creating handful of function in OOP way.Here is my code..
(function (window) {
var myCustomClass = function () {
debugger;
return new myCustomClass.mycustomFunction.Init();
};
myCustomClass.mycustomFunction= myCustomClass.prototype = {
Init: function () {
return this;
},
alert: function () {
alert('I got called');
}
};
window.$ = window.mQuery = myCustomClass;
})(window);
and trying to use in this way:
mQuery().alert();
but it is giving an error , I am trying to figure it but with no avail. I think , I am missing some concept ,please direct me on the right direction.