UnityScript and JavaScript have very different semantics.
Creating a new JavaScript file in Unity with this syntax will not compile.
#pragma strict var x = { y: 12 // error: BCE0005 }; function Start () { Debug.Log (xy); // error: BCE0019 }
This will result in build errors:
NewBehaviourScript (4,5): BCE0005: unknown identifier: 'y'.
NewBehaviourScript (8.17): BCE0019: 'y' is not a member of Boo.Lang.Hash.
However, you can implement a Hashtable :
#pragma strict var x:Hashtable = new Hashtable(); x["y"] = 12; function Start () { Debug.Log (x["y"]); }
source share