- Home /
Question by
Stickworm · Nov 24, 2012 at 02:45 PM ·
javascriptreferenceref
Is it possible to pass a variable by reference in javascript
Hello
Now that it's been a while and Unity 4 is out is it possible to pass a variable by reference in javascript yet as you can in C#?
Cheers
Comment
Stick, it looks like they still have not done this in Unity4
http://answers.unity3d.com/questions/350507/unity4-unityscript-added-ref-or-out-keyword.html
I am sure you know the workaround, just make it a small object (you can of course pass objects by reference). Hope it helps
O$$anonymous$$ thank you both, for anyone else who wants to know in more detail that link has plenty of discussion about it. Cheers
Best Answer
Answer by Eric5h5 · Nov 24, 2012 at 04:46 PM
Not explicitly. Only if the variable is already a reference type.