I have a JSON object similar to this one

```
{
 "x": [
       {
         "key": "value"
       },
       {
         "key2": "value2"
       }
      ]
}

```

And doing `console.log(x[0].key)` won't return 'value'. Instead I get an error saying that x is undefined. 

Any ideas?

Thank you