javascript calling a class method -
javascript calling a class method -
hey hava function acts class.
var myclass= function () { this.property = ''; this.say() = function () { alert('say hello'); } when initialize this
var myclassobj= new myclass(); myclassobj.property = 'property'; myclassobj.say(); it gives me error on initialization "uncaught typeerror: undefined not function". whats doing wrong.
use this.say instead of this.say().
javascript
Comments
Post a Comment