When I ran the code in browser console or in js fiddle, this code snaps off the browser. I don't understand why it does. Can some one show some light ?
var sample = [1, 2, 3, 4];
function arrDupli(sample) {
var mysample = sample;
for (var i = 0; i < sample.length; i++) {
mysample.push(sample[i]);
}
console.log(mysample);
}
arrDupli(sample);