How to reset an array
To archive better performance you should do: var arr = [1, 2, 3]; arr.length = 0;
To archive better performance you should do: var arr = [1, 2, 3]; arr.length = 0;
var arr = [1, 2]; Object.prototype.toString.call(arr) === "[object Array]"
Array.prototype.clone = function() { return this.slice(0); }