I ran into a problem with my javascript code.
I have a class MyClass and added function myFunction to its prototype.
MyClass.prototype.myFunction = function(file){
    if(some condition){
       fs.exists("./" + file, function(exists){
           if(exists)
               console.log(this.someValue);
               /* lot of other code */
           else
               /* do something else */
    });
    }else{
        /* do something */
    }
}
My problem is the scoping of this.someValue(as an example I want to just print it).
Everytime exists equals true the console logs undefined but it is not.
If I would print it outside of fs.exists() then it has a value so I guess it is a scoping problem.
How can I access this.someValue in this sample?
Thanks in advance!
 
     
     
     
    