Dictionary.TryGetValue for js

I’m trying to use a dictionary’s TryGetValue in js, but i would need to pass a variable by reference.

though it seems js cant use ‘ref’ or ‘out’ to pass by reference. line in questions is like this:

var containerChunk : Chunk;
chunks.TryGetValue(pos, containerChunk);

i know js does alot of things automatically, but is that containerChunk var being passed by ref automatically by any chance?
or do i need to break this line down like:

if(chunks.ContainsKey(pos))
{
	containerChunk = chunks[pos];
}

or is there some way to pass by ref in js that i don’t know about?

If a variable needs to be ref or out, then it is automatically, or else standard Unity functions such as Physics.Raycast (i.e. out hitInfo) wouldn’t work.