async icon indicating copy to clipboard operation
async copied to clipboard

Request For Explanation .... How To

Open forensicsguy20012004 opened this issue 10 years ago • 1 comments

So, I ran across this module, just last night and I think it will be helpful .... I just need a little "show and tell." Below you can see my function "GetBearerToken" which takes a parameter {bearer_token:token}.. no issues there...my problem is ...the variable "ss" I want to use it outside of this function...pass it to another function to do something then....of course when I try and access the "ss" the variable is undefined. I posted this question on stackoverflow...but it was considered a duplicate. So any help would be great...Thanks

GetBearerToken ({bearer_token:token},function (error, result) {         
if (error) throw error;
 if (result) 
    {
        var resultset
        var i;
        for (i=0; i< result.length; i++)
        {              
            resultset = (simpleObjectify(result[i].meta, result[i].rows))
        }       

        var jstring = JSON.stringify(resultset);
        var obj = JSON.parse(jstring);
        var ss = obj[0].uuid;
        console.log(ss)
        })

outside of function ss = undefined

forensicsguy20012004 avatar Apr 21 '16 10:04 forensicsguy20012004

This is not related to this module. Place the variable definition ss outside of the function scope

megawac avatar Apr 21 '16 18:04 megawac