I have a JavaScript object like
var obj = { key1: \'value1\', key2: \'value2\', key3: \'value3\', key4: \'value4\' }
How can I
obj = {'a':'c','b':'d'}
You can try:
[index for (index in obj)]
this will return:
['a','b']
to get the list of keys or
[obj[index] for (index in obj)]
to get the values