title: How to do that in Javascript
body: <p>I know PHP and learning Javascript Now, I want to ask that how can I do the stuff here in this PHP code in Javascript?</p>
  <pre><code>PHP Code: 
  
  $name = &quot;Jhon Doe&quot;;
  echo &quot;The old name was $name&quot;;
  $name[0] = &quot;F&quot;;
  echo &quot;The new name is $name&quot;;
  </code></pre>
  <p>How to get the same result in Javascript?</p>
  <pre><code>JS =&gt; ?
  </code></pre>