Get information from a JSON file with spaces

1

I'm developing an application using JavaScript and I need to get some information from a JSON file, but this file comes with spaces. I wonder if it's possible to get this information even with the spaces?

{
     "Meta Data": {
            "1. Information": "Intraday Prices and Volumes for Digital Currency",
            "2. Digital Currency Code": "BTC",
            "3. Digital Currency Name": "Bitcoin",
            "4. Market Code": "EUR",
            "5. Market Name": "Euro",
            "6. Interval": "5min",
            "7. Last Refreshed": "2018-07-27 00:25:00",
            "8. Time Zone": "UTC"
}, ...
    
asked by anonymous 27.07.2018 / 03:29

1 answer

2

I had the same problem, I had to consume an API that had properties with spaces and hyphens, use:

obj["prop 1"];
obj["prop-2"];
obj["prop. 3"];
//...
    
27.07.2018 / 03:46