title: Factorial function returning NAN
body: <p>I am new to javascript, I am trying to write a function that calculate the factorial of a given number and also replace the fourth element. I expect when the code above is run, it should produce <code>6GeXmanX</code> but instead i am getting <code>NaNXermXny</code></p>
  <pre><code>function Recursion(num) {
    
    if (num=== 0 || num===1){
      return 1;
    }
    result= Recursion(num-1)*num;
    
    results = result + 'Germany'
    const str = results.split('')
    const nth = 4
    var replaceWith = 'X'
    for (var i = nth-1; i &lt; str.length-1; i+=nth){
      str[i]= replaceWith;
      
      
    }
    //y = (results.join(&quot;&quot;))
    return (str.join(&quot;&quot;));
    
    }
    
  
  
    // code goes here  
     
  // keep this function call here 
  console.log(Recursion(3));
  </code></pre>