Skip to content Skip to sidebar Skip to footer

How To Access Property With Leading Numbers In Name

var jsonJSON = UrlFetchApp.fetch('https://wowtoken.info/snapshot.json'); var json = Utilities.jsonParse(jsonJSON.getContentText()); var max24 = json.NA.formatted.24max; I'm sure

Solution 1:

Instead of removing the numbers in front of the object names during parsing, you can also access the object's property like you would access an array element like so.

json.NA.formatted["24max"]

JavaScript variables must begin with a letter, $ or _. That is the reason why you are getting an error instead.

Post a Comment for "How To Access Property With Leading Numbers In Name"