Even if there are no "real" objects in javascript I'm struggling on how to make them distinct to each other.
For example I have the two objects Apple and Orange defined like this:
function Apple(){
this.name = "Apple";
}
and
function Orange(){
this.name = "Orange";
}
In an OOP point of view, the two name attributes are not connected as they are properties of different classes.
My problem/question is, that when renaming the name property of the class Apple, ReSharper will also ask me to rename the property of class Orange. Also pressing F12 (GOTO DEFINITION) will show me both properties.
But why? Are they defined in global scope? How can I distinct them so Orange and Apple are real different objects?
Aucun commentaire:
Enregistrer un commentaire