What you do here is pass an object to the constructor of the class sap.m.Button
. What happens with that object in the constructor is up to the implementation. It doesn't necessarily has to add them to the object. In this case they are likely stored in a local variable of the object. The constructor likely looks something like this:
sap.m.Button = function(properties) {
var text = properties.text; // private variable only visible in the scope of the class
this.getProperty(key) { // public function - as denoted by the prefix "this."
if (key == 'text') {
return text; // returns the value of the private variable
}
// ... and more code for other properties ...
}
// ... and much more stuff ....
}
But you can add public variables to an object later:
var myButton = new sap.m.Button({text:"Hello"});
myButton.myVariable = "foo";
colsole.log(myButton.myVariable); // outputs "foo"