How to call a prototyped function from within the prototyped "class"?

Posted by Jorge on Stack Overflow See other posts from Stack Overflow or by Jorge
Published on 2010-05-01T21:36:19Z Indexed on 2010/05/01 21:47 UTC
Read the original article Hit count: 160

Filed under:
|
|
|
function FakeClass(){};  
FakeClass.prototype.someMethod = function(){};
FakeClass.prototype.otherMethod = function(){
    //need to call someMethod() here.
}

I need to call someMethod from otherMethod, but apparently it doesn't work. If i build it as a single function (not prototyped), i can call it, but calling a prototyped does not work. How can i do it as if i was treating the function just like a class method?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about prototype