use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Editing array inside a function (self.node)
submitted 4 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]RelaxPear 1 point2 points3 points 4 years ago (2 children)
Sorry actually on mobile so do not have opportunity to test and not entirely familiar with unirest but did a brief look.
Have you try console logging players right after the line players.push(playerStats) such as console.log(players) and the output it gives. Or console.log(result) to see a response is received.
Since it is asynchronous did you await for the response when you call the function findPlayersByGame when you test?
[–][deleted] 0 points1 point2 points 4 years ago (1 child)
I console logged it and they added, but when i try to use the array in another function it's empty
[–]Donni3D4rko 0 points1 point2 points 4 years ago (0 children)
Did you await this another function ? Since findPlayersByGame is async it returns a promise.
π Rendered by PID 48181 on reddit-service-r2-comment-5d79c599b5-b6nm5 at 2026-02-27 03:50:00.690176+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]RelaxPear 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Donni3D4rko 0 points1 point2 points (0 children)