how to access an immediate unknown key in an object. in pic, "367: sl" is a dynamic key, and I want to access the cptyName value, which is located in "367: sl". thanks in advance
If your dynamic key is the only key in the object quotes, you can get the first key, and then access it with:
quotes
var firstKey = Object.keys(quotes)[0]; var cptyName = quotes[firstKey].cptyName;
http://jsfiddle.net/mGZpa/
You can iterate through an object.
var quotes = { '367:sl': 'cptyname' } for(var i in quotes) { alert(quotes[i]); }
Demo
Source: https://habr.com/ru/post/1545198/More articles:How to fix nodes when building a subset in a complete network using igraph R - rWhy is this unusual Objective-C design design a bad idea? - objective-cOpenGl alpha test - How to replace AlphaFunc with obsolete? - alphaGoogle Tag Manager Positioning - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1545197/ways-to-improve-extremely-slow-codeigniter-website&usg=ALkJrhijkoKCplamK54z2sKpbqqCMk_IiABeacon service rating in the background - androidhow to disable warning for niogroovymethods - javaCreating a progress bar in a circle - jqueryСоздание кривой ROC с помощью GGPLOT - rAttribute binding in a prototypically inherited area - angularjsAll Articles