In JavaScript you can create objects and assign attributes to them on-the-fly.
For example:
or you can get all OO about it (recommended) and actually create a new reusable JS class:
and using the
.prototype attribute you could even give this JS class methods (such as accessors and mutators for the members, or other methods that may be useful).
I highly recommend
this book to learn what you can do with JavaScript.
hth,
bear