title: Using split/join to replace a string with an array
body: <p>I'm trying to replace the value of <code>item</code> with values ​​in the array <code>arr</code>, but I only get that if I use: <code>arr [1]</code>, <code>arr [2]</code> ...  if I just let
   <code>arr</code>, returns <code>abcdefg</code>.</p>
  
  <p>I am PHP programmer, and I have a minimal
  notion with JavaScript, can someone give me a light?</p>
  
  <pre><code>var item = 'abcdefg';
  var arr = new Array();
  arr[1] = "zzz";
  arr[2] = "abc";
  var test = item.split(arr);
  alert(test.join("\n"));
  </code></pre>