标签:属性 col test bsp obj i++ var color har
function 对象属性遍历(){
var obj = {x:1,y:2,c:3};
for (var name in obj){
alert ( obj[name] )
}
}
function 数组(){ var 数组=[1,2,3,[1,2,4,5,7,8],4,5]; //数组嵌套数组 var 数组2=[ {x:100}, 2, [7,8,9], function(){ return 999; }(), "abc" ] var arr =new Array(10); arr[20]=100 alert(arr) };
function test(){ //数组嵌套数组 var str ="yiyuyan"; return str.charAt(6) //alert(字符串[5]); };
function test(){ //数组嵌套数组 var arr =[1,2,3,4,5,6,7,8,9,10] , sum =0; for(var i=0;i<arr.length;i++){ sum +=arr[i]; } alert (sum) ; //alert(字符串[5]); };
标签:属性 col test bsp obj i++ var color har
原文地址:https://www.cnblogs.com/aladam/p/10771912.html