UnityScript equivalent of JavaScript objects

In JavaScript you can use objects as simple dictionaries, and there is a concise syntax for expressing object literals.

E.g.

var someLookUp = {
	foo: 2,
	bar: {
		a: 1,
		b: 2,
		c: 3
	}
};

someLookUp['bar']['b']; // 2

How can I do these kinds of things with UnityScript?

I realize this question is old as dirt, but what you’re looking for are Hashtables.

http://docs.unity3d.com/412/Documentation/ScriptReference/Hashtable.html

Maybe you’re looking for classes and/or structs?

class Bar extends System.ValueType { // struct
    var a : int;
    var b : int;
    var c : int;
    function Bar (a : int, b : int, c : int) {
    	this.a = a; this.b = b; this.c = c;
    }
}

class Something {
    var foo : int;
    var bar : Bar;
    function Something (foo : int, bar : Bar) {
        this.foo = foo; this.bar = bar;
    }
}
// ...

var lookup = new Something (2, Bar(1, 2, 3));
print (lookup.bar.b);