yuku-t/jquery-textcomplete — pull request #1 by ykzts (2013-09-03 01:28:09+00:00)
Title: toArray using slice

```javascript
(function() {
'use strict';

function toArrayUsingFor(args) {
var i, l, result;
result = [];
for (i = 0, l = args.length; i < l; i++) result[i] = args[i];
return result;
}

function toArrayUsingSlice(args) {
var result;
result = Array.prototype.slice.call(args);
return result;
}

var args = (function() {
var args = [];
var value;
while (args.length < 1000000) {
value = Math.random().toString(36).slice(2);
args.push(value);
}
return args;
})();
var i = 0;

console.time('for');
toArrayUsingFor(args);
console.timeEnd('for'); // 36.874ms

console.time('slice');
toArrayUsingSlice(args);
console.timeEnd('slice'); // slice: 13.100ms
})();
```

300% faster!!!