js字典
1、遍历
var json={ "name":"乔峰", "age":"10", "sex":"男" }; for(var key in json){ console.log(key+":"+json[key]); }
2、通过下表获取
var ViewType = { a: "a", b: "b", c: "c" }; var keys = Object.keys(ViewType) var values = Object.values(ViewType) console.log(keys[1] + ':' + values[1])
此字典无法在QML中声明,不然会报错: javascript declaration outside script element
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html