title: Argument type Number is not assignable to parameter type String|Function
body: <pre><code>var str = name.toUpperCase();
  var ch = new Array();
  ch = str.split('');
  
  for(var i=0;i&lt;7;i++)
  {
    if(ch = null) {
      result_code.replace(
        pos.toString()+pos.toString()+pos.toString()+pos.toString(),
        "FFFF");
    } else {
      var temp = parseInt(ch[i]);
      var temp_integer = 64;
      if(temp&lt;=122 &amp; temp&gt;=97) {
        var pos = i+1;
        result_code.replace(
          pos.toString()+pos.toString()+pos.toString()+pos.toString(),
          (temp - temp_integer)+40);
      }
    }
  }
  </code></pre>
  
  <p>This code is creating the error at this line <code>result_code.replace(pos.toString()+pos.toString()+pos.toString()+pos.toString(), (temp - temp_integer)+40);</code>. </p>
  
  <p>The underlined information is this section <code>(temp - temp_integer)+40</code>.</p>
  
  <p>The error shown is <code>Argument type Number is not assignable to parameter type String|Function</code>. </p>
  
  <p>What is wrong with this code? I am using WebStorm. I am likely just making a dumb mistake. Thanks in advance!</p>