var
myobject = new
Object();
myobject.welkin1 = 'gunther1';
myobject.welkin2 = 'gunther2';
myobject.welkin3 = 'gunther3';
var
myarray = new
Array('gunther1','gunther2','gunther3');
var
content='';
for(var
key in
myobject){
content += key+':'+ myobject[key]+'<br/>';
}
for(var
key in
myarray){
content += key+':'+ myarray[key]+'<br/>';
}
輸出結果:
welkin1: gunther1
welkin2: gunther2
welkin3: gunther3
0 : gunther1
1 : gunther2
2 : gunther3
全站熱搜
留言列表