Array:
新建:var ary = new Array(); 或 var ary = [];增加:ary.push(value);刪除:delete ary[n];遍歷:for ( var i=0 ; i <ary.length ; ++i ) ary[i];
Object:
新建:var obj = new Object(); 或 var obj = {};增加:obj[key] = value; (key為string)刪除:delete obj[key];遍歷:for ( var key in obj ) obj[key];
沒有留言:
張貼留言