标签:javascript
使用字面量语法创建数组
//good var items = []; //bad var items = new Array();
var items = []; //good items.push('abc'); //bad items[items.length] = 'abc';
var len = items.length ; var itemsCopy = []; var i; //good itemsCopy = items.slice(); //bad for(i=0;i<len;i++){ itemCopy = items[i]; }
function tranA(){ var args = Array.prototype.slice.call(arguments); }
标签:javascript
原文地址:http://blog.csdn.net/princeterence/article/details/45693713