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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -