Hi all, sorry for the newbie question. I really love the way Javascript objects inherit directly from other objects, rather than via a class structure. It seems lie a much more sensible way of doing things in an interpreted language. I have a small question though about something that seems to me like it should work but doesn't. If I define an object in an object literal like:

var father = {
i: "rudi",
f: function() {

>> "rudi"

I'm basically declaring an associative array or hash here containing 2 variables, one of which points to a string, and the other to a function I think. But if I do:

var son = {


I get an error. Surely the prototype is an variable with the object as it's scope. If so, why can I not set it directly in the object literal? It clearly doesn't work, but Id love to know why.

Many thanks