Is there an equivalent in JavaScript for PHP's reference passing of variables?
PHP:
:function addToEnd(&$theRefVar,$str){ $theRefVar.=$str;}$myVar="Hello";addToEnd($myVar," World!");print $myVar;//Outputs: Hello World!How would the same code look in JavaScript if possible?Thank you!