how to access immediate unknown key in object. in pic "367:sl" is dynamic key and i want to access cptyName value which is in "367:sl". Thanks in advance
How to get all property values of a JavaScript Object (without knowing the keys) ? Method 1: Using Object. values() Method: The Object. values() method is used to return an array of the object's own enumerable property values.
If your dynamic key is the only key in quotes
object, you can get the first key and then access value with:
var firstKey = Object.keys(quotes)[0];
var cptyName = quotes[firstKey].cptyName;
http://jsfiddle.net/mGZpa/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With