如何访问对象中的立即未知密钥 [英] how to access immediate unknown key in object
本文介绍了如何访问对象中的立即未知密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何访问对象中的立即未知密钥.在图片"367:sl"中是动态密钥,我想访问"367:sl"中的cptyName值.预先感谢
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
推荐答案
如果动态键是 quotes
对象中的唯一键,则可以获取第一个键,然后使用以下方法访问值:>
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;
这篇关于如何访问对象中的立即未知密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文