标签:cti rip function str family javascrip ons foreach mil
var obj = {‘0‘:‘a‘,‘1‘:‘b‘,‘2‘:‘c‘};
Object.keys(obj).forEach(function(key){
console.log(key,obj[key]);
});
var obj = {‘0‘:‘a‘,‘1‘:‘b‘,‘2‘:‘c‘};
for(var i in obj) {
console.log(i,":",obj[i]);
}
var arr=[1,2,3,4];
arr.forEach(function(val, index) {
console.log(val, index);
});
标签:cti rip function str family javascrip ons foreach mil
原文地址:http://www.cnblogs.com/chenyablog/p/6477866.html