title: clone js array w/ objects and primitives
body: <p>Given the array:</p>
  
  <pre><code>['1', {type:'2'}, ['3', {number: '4'}], '5']
  </code></pre>
  
  <p>I need to make a clone <strong>without</strong> using the <code>slice</code>, <code>json.parse</code> and other methods. </p>
  
  <p>At the moment, the code is working, but it will not clone objects:</p>
  
  <pre><code>var myArr =['1',{type:'2'},['3',{number:'4'}],'5'];
  var arrClone=[];
  for(var i=0;i&lt;myArr.length;i++){
  if(typeof(myArr[i])==='object')
  {
      var arr=[];
      for(var j=0;j&lt;myArr[i].length;j++){
          arr[j]=myArr[i][j];
      }
  
  
      arrClone[i]=arr;
  }else { arrClone[i]=myArr[i]}
  
  }
  </code></pre>