javascript objects/json question

i want to create an array that contains simple objects. but i can’t figure out how to create simple objects.

if this was actionscript i’d do this:
var spot:Object = new Object();
spot.open = true;
spot.position = new Vector2(x,y);

or normally in javascript i’d just do this:
var spot = {open:true, position: new Vector2(x,y)};

how do i do this in unity’s javascript?

The Object class you’re creating is - AFAIK - nothing but a base class to extends from, useful as a common base for pretty much every Unity objects but nothing in itself. What you want to do is probably create your own class that derives from it and add the variables you need to the new class/type. Then create an object of MyClass instead of Object. Using JS, its as simple as adding:

public class MyClass
{
    public var myString:String = "";
    public var myInt:int = "";

    //custom constructor
    public MyClass(someInt:int)
    {
        myString = "default";
        myInt = someInt;
    }
}

var myObject:MyClass = new MyClass(1337);
myObject.myString = "neat";

You might want to take a look at Newbie Javascript Guide as UnityScript is not quite true JavaScript.