how to access immediate unknown key in object

前端 未结 2 496
走了就别回头了
走了就别回头了 2020-12-20 23:34

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

2条回答
  •  萌比男神i
    2020-12-20 23:49

    You can iterate through the object.

    var quotes = {
        '367:sl': 'cptyname'
    }
    
    for(var i in quotes) {
        alert(quotes[i]);
    }
    

    Demo

提交回复
热议问题