title: Duplicate function javascript
body: <p>Please help, I don't know what's wrong in my code. I'd like to make a function which duplicates array like:
  fuction duplicate([1,2,3,4]
  answer: [1,2,3,4,1,2,3,4].</p>
  
  <pre><code>var arr1 = [];
  
  function duplicate(arr){
     arr1 = arr;
     for(var i = 0;i&lt;arr.length;i++){
        arr1.push(arr[i]);    
     }
     return arr1
  }
  </code></pre>
  
  <p>Thanks for any help</p>