title: If String is immutable in javascript then how splice method changing the original String?
body: <p>As i heard, String is immutable in JavaScript then how splice method changing the original String?</p>
  
  <p>As I know
  <code>var name = 'Alto';</code>// it will create an new object in global space memory with 'alto' and assign to name reference.</p>
  
  <p><code>name = 'swift';</code> // it will create an new object in global space memory and with 'swift' assign to name reference. ('Alto' string object will be moved to garbage collector whenever possible).</p>
  
  <p><code>var newName = name.slice(0,2);</code>// here splicing the 'sw' from 'swift' create an new Object in global space and assign to newName. name will have 'swift' since string is immutable.</p>
  
  <p><code>var newName1 = name.splice(0,2);</code>// here cut the 'sw' from 'swift'(original string) and assign to newName. now name will have 'ift'. so how String is an immutable?</p>
  
  <p>Can anyone explain the process behind splice?</p>