Your examples are representing relationships between objects, not classes, so the UML object diagram is the way to go (as RobertMS has pointed out already).
The objects are related to each other in the sense that (in the first case) object a
is the prototype of object b
. I would use a dependency relationship for this. Wikipedia has a good description of the UML dependency notation here.
The rationale for using a dependency is that it reflects the notion that "a change to the influent or independent modeling element may affect the semantics of the dependent modeling element." Since we often use prototype objects to hold default properties, as well as methods, for a collection of "dependent" objects (i.e., objects of the same "class"), this use of dependency seems justifiable, if not maybe a little controversial.
I would label the dependency with the stereotype "<<proto>>".
UML does give you a lot of flexibility, though it is nice to follow convention.
There is a good treatment of object diagrams on this page by Scott Ambler.
In your second example, using jQuery's extend
function, you don't have a true prototype relationship, but you are merging properties from some objects into another object. In this case, I'm not sure that there is a specific overarching modeling term for this. There is a kind of dependency here, though. I would suggest looking through the list of standard UML dependency stereotypes (listed on the above-mentioned Wikipedia page) and see if anything makes sense in your specific application. Perhaps <<refine>> works for you?