Javascript doesn't use any sort of classes or object-types. It mostly handles in strings.
The string you get can be used together with an object to get the actual value. You can use obj.get(domainname) to retrieve the value.
Edit
Retrieving attributes over an association is trickier. You need to separate the association part, use that with obj.getChild(assocname) and use that object to get the 3rd part of the association.
You can use domainname.split("/") and use split[1] for the association and split[2] for the attribute part. Note that this only works for 1-deep association but that is the only one supported anyway.
You can take a look at the Format String widget for an example. It uses the GetEverything function I've mentioned earlier in a different Forum question.