favorite_language ={ "jen":"python", "sarah":"c", "edward":"ruby", "phil":"python", } for name in sorted(favorite_language.keys()):# sort by zimushunxu print(name.title()+&quo
一 .for in 循环 1.获取json中的键(key)与值(value): var data = {name:'张三',age:'20岁',sex:'男'}; for (var a in data) { console.log(a); /*属性名*/ console.log(data[a]); /*属性值*/ }; 2.获取数组中的值 var a = ['apple','banana','pear']; for(var i in a){ console.log(i); /*在数组中的位置*/