I need some help understanding some JavaScript code. Here is the code:
MyVar.js:
var MyVar = (function($){
var _this;
...
function myVar()
{
_this = this;
}
myVar.prototype.test()
{
console.log("Hello World");
}
...
})(window.jQuery);
From an ASP.NET view:
var myVar = new MyVar();
myVar.test();
I've tried running this code in a JSFiddle example, but I get an error. How exactly does this code work?
Edit:
This is the error I am getting: Uncaught TypeError: myVar.prototype.test is not a function.