Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

generator in classs js

class Reply{
    *getReply (msg){
        //...
        return reply; 
    }
     *otherFun(){
        this.getReply();  //`this` seem to have no access to `getReply`
    }
}
var Reply = new Reply();
Reply.getReply();   //out of class,how can I get access to `getReply`?
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generator #classs #js
ADD COMMENT
Topic
Name
9+4 =