How does unity/javascript handle object references?

I just discovered that I could use this code to lock rotation to the initial rotation of a gameobject:

#pragma strict

var initialRotation : Quaternion;

function Start () {
	initialRotation = transform.rotation;

function Update () {
	transform.rotation = initialRotation;

All my previous experience is in pure Java, where this code wouldn’t do anything. The object pointed to by transform.rotation would always be the same you point to in initialRotation.

How are object references handles in Unity? Do they exist at all, or are all values simply copied?

Classes are by reference, structs (such as Quaternion) and primitive types are by value.