var ar  = new Array(1,2,3,4);
console.log('Real Array : '+ ar);

                          // Method 1
var NewAr= ar.slice('')
console.log(NewAr);

                          // Mathod 2
var n = Array.from(ar);
console.log('Clone array :'+n);

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: