Automatically updating the actual parameters in javascript
<p>How to pass a primitive variable (like a string) by reference when calling a java script method?
Which is equivalent of out or ref keyword in C#.</p>

<p>I have a variable like <code>var str = "this is a string";</code> and passing the str into my function and automatically have to reflect the change in str when i change the argument value</p>

<pre><code>function myFunction(arg){
    // automatically have to reflect the change in str when i change the arg value
    arg = "This is new string";
    // Expected value of str is "This is new string"
}
</code></pre>
