title: How to replace a single index of a string for a number?
body: <p>I want to replace vowels in a string with numbers, but I can not get it working.<br>
  This code I am showing, I am only doing the vowel "e", here is my code:</p>
  
  <pre><code>var string = prompt("Enter anything with letters only");
  console.log("You wrote: " + string);
  
  for(k=0; k&lt;string.length; k++){
  
    if(string[k]=="a"){
      console.log(string[k]);            
    }
    if(string[k]=="e" || string[k]=="E"){
      console.log("found: " + string[k]);
      string[k] = "2" ;  // Here is where I am trying to replace the vowels "e" to value 2
    }
    if(string[k]=="i" || string[k]=="I"){
      console.log("found: " + string[k]);
    }
    if(string[k]=="o" || string[k]=="O"){
      console.log("found: " + string[k]);
    }
    if(string[k]=="u" || string[k]=="U"){
      console.log("found: " + string[k]);
    }
  }
  console.log(string);
  </code></pre>
  
  <p>Please note I am very new to javascript, this is why I am doing simple <code>for</code> loop exercises with no special comands or shorcuts.</p>
  
  <p>I have tried: <code>string[k] = 2</code> and also <code>string[k] = (variable with the value 2)</code></p>
  
  <p>Any sugestions?</p>