I have implemented a simple method to clone an array.
Array.prototype.clone = function () {
return JSON.parse(JSON.stringify(this));
};
If I use this code, all arrays in my application have the last element that is this clone function!
Any ideas? xD
Thank you.

4having four elements,cloneis not defined on that array. Why did you implemented a simple method to clone when you could use.slice(0)to create copy of an array?