Hey I hava a function which acts like a class.
var myClass= function () {
this.property = '';
this.say() = function () {
alert('Say Hello');
}
When I initialize it like this
var myClassObj= new myClass();
myClassObj.property = 'property';
myClassObj.say();
It gives me the error on initialization "Uncaught TypeError: undefined is not a function". Whats I am doing wrong.
this.say() = function=>this.say = function. You don't want to invokethis.sayimmediately (which isundefinedat this point).this.say()tries to callthis.say, butthis.saydoes not exist.