Java 스크립트 메소드를 호출 할 때 참조로 원시 변수 (문자열과 같은)를 전달하는 방법은 무엇입니까? C#에서 out 또는 ref 키워드와 동일합니다.자바 스크립트의 실제 매개 변수를 자동으로 업데이트
나는 var str = "this is a string";
같은 변수 i가 인수 값을
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"
}
가능한 중복 http://stackoverflow.com/questions/373157/how-can-i-pass- a-function-with-parameters-with-parameters –
이것을 확인하십시오 : http://snook.ca/archives/javascript/javascript_pass/ – kol
가능한 복제본 [자바 스크립트로 참조 문자열 전달] (http : // stackoverflow.com/questions/1308624/pass-a-string-by-reference-in-javascript) –