Even though JavaScript doesn't have tangible objects, I'm struggling to differentiate between them.
Let's say we have two objects called Apple and Orange defined as follows:
function Apple(){
this.name = "Apple";
}
and
function Orange(){
this.name = "Orange";
}
From an OOP perspective, the name attributes of Apple and Orange are not related since they belong to different classes.
My issue/question is that when I rename the name property in the Apple class, ReSharper prompts me to also rename the property in the Orange class. Furthermore, pressing F12 (GOTO DEFINITION) shows both properties.
Why does this happen? Are they declared in the global scope? How can I make sure Apple and Orange are distinct objects?