title: Is it good practice to override function parameter value?
body: <p>In JavaScript consider I am trying to append a new value and return it. </p>
  
  <p>I have below example regarding overriding parameter value</p>
  
  <p>The below function receives a string value as param and overriding the param with new value and returning it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function test(value) {
    value = value + "hi";
    return value;
  }
  console.log(test("Hello"));</code></pre>
  </div>
  </div>
  </p>
  
  <p>The below function receives a string value as param. I would like to append a new value and return it. So I assigned value to a local variable and then appended strong to a new variable and returning it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function test(value) {
    let temp = value;
    temp = value + "hi";
    return temp;
  }
  console.log(test("Hello"));</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am  calling it and passing value</p>
  
  <pre><code>  test(“Hello”);
  </code></pre>
  
  <p>Which one is recommended from above?</p>