'How do I parse a Playfab GetLeaderBoard request result?
I'm trying to work with the PlayFab JS API to set up a leaderboard in my game, and once I retrieve the leaderboard I can not figure out how to parse the returned object correctly. I can confirm the leaderboard data is in the returned API request object by printing the whole thing, but I can't parse the object. Here's an example of the object that I receive back from Playfab:
Promise {<fulfilled>: {…}}
[[Prototype]]: Promise
[[PromiseState]]: "fulfilled"
[[PromiseResult]]: Object
CallBackTimeMS: 243
CustomData: undefined
Request: {StartPosition: 0, StatisticName: 'Score', CustomId: '2.1159277813360245e+25'}
code: 200
data:
Leaderboard: (10) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
Version: 2
[[Prototype]]: Object
status: "OK"
[[Prototype]]: Object
I'm trying to access the data in the "Leaderboard" section above.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
