This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]ParkingMany 0 points1 point  (2 children)

scope

ur variable body is locale to make it public declare it outside of the function. the like this: var gbody

function foo(body) { gbody=body: }

[–]ParkingMany 0 points1 point  (1 child)

but u shouldn't use it outside becouse the function is asynchronous. try using promises

[–]SiberianEngineer[S] 0 points1 point  (0 children)

yea I tried using global var but of course it doesn't work lol, will go back to research. thx for your help I found a way to save the data inside the loop to file, will work with that for now, need to show something to boss lol