Skip to content

Instantly share code, notes, and snippets.

@bananaumai
Created March 23, 2015 06:58
Show Gist options
  • Save bananaumai/cc2f4d90662aa823ce9e to your computer and use it in GitHub Desktop.
Save bananaumai/cc2f4d90662aa823ce9e to your computer and use it in GitHub Desktop.
lodashのcloneを用いた実装
var _ = require('lodash');
function iPush(arr, val) {
var arr2 = _.clone(arr);
arr2.push(val);
return arr2;
}
var arr = [];
for (var i = 0; i < 100000; i++) {
arr = iPush(arr, i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment