Here is original question: [Getting JavaScript object key list](https://stackoverflow.com/questions/3068534/getting-javascript-object-key-list)

But if the situation is little bit more complex like:

```
var obj = [
   { key1: 'value1' },
   { key2: 'value2' },
   { key3: 'value3' },
   { key4: 'value4' }
]

```

Then how you get keys like that?

```
[key1,key2,key3,key4]

```