I have a object that is parsed from JSON, and it always contains only one property but the name of this property (i.e. the key name) changes for each JSON msg.
In IE9+ and other modern browsers, I can use:
value = msg[Object.keys(msg)[0]];
to access the value of this property. However, IE8 does not support keys, so what is a fully compatible way of accessing the value?
You could define such a function :
and then do