Yes. That's the whole fundamental point of objects -- every object is self-contained. Two distinct objects won't have any effect on each other, and the stuff inside an object is unrelated to the stuff outside the object.
It should also be noted that names have scopes. That is, a given name is only applicable inside a certain region. If you define a variable outside of any functions, that variable is global and everything can see it, unless you declare a new variable inside a function (with the "var" keyword) then that one will hide the global one. If you have a function defined inside a function (way more common than you might expect) then variables in the outside function are visible to the inside function, but not vice versa.
Names in objects are the same way -- the names of the properties are scoped to the object. The name has no meaning anywhere except when referring to a property of that specific object.
Every "a" in this example is distinct and unrelated to the others:
Code:
var a = 3;
var b = 'b';
var x = { a: 1 };
var y = { a: 2 };
// you can only see b here
function foo() {
var a = 4;
var c = 'c';
// you can see b and c here
function bar() {
var a = 5;
var d = 'd'
// you can see b, c, and d here
}
// back outside of the definition of bar, you can only see b and c here
}
x.a = 6;
// y.a is still 2, because they're separate objects
The main thing to watch out for is that it's possible to have two objects that LOOK the same but are actually separate objects, or two objects that you think might be separate objects that are actually the same. You can actually check for this in code -- two objects only evaluate as == to each other if they're the same concrete object, even if all of their properties are equal.
As far as the syntax... Yes, it's probably inspired by set notation historically. No, you probably shouldn't try to think of them as sets, because they don't really act like sets -- you can't easily see how full an object is or if it's empty, and two empty objects aren't equal to each other. It's better to think of them as dictionaries -- if you have a name, you can look up what it means inside.
EDIT: It occurs to me that you used "window.img" in an earlier post and I forgot to respond to that.
Accessing images on the page... doesn't work like that. :P But you can put an "id" attribute on an <img> tag and use "document.getElementById" to get that in your script, then store that in a variable.