I am new to Javascript since my SO profile will attest.
I just read a few tutorials and came across something that I donβt quite understand regarding Object Orientation and Encapsulation when applied with Javascript.
The tutorial states that Javascript objects can be declared as follows:
var myCustomObject = new Object();
And you can give it instance variables like this:
myCustomObject.myVariable = "some value";
myCustomObject.myOtherVariable = "deadbeef";
Finally, it says that you can create a template function to create new objects, such as:
function CustomObject(myVariable, myOtherVariable)
{
this.myVariable = myVariable;
this.myOtherVariable = myOtherVariable;
}
I also know that you can create and assign values ββto variables that do not yet exist, and as a result are declared implicitly, as shown in the example where it myCustomObjectdoes not myVariable, but now it does.
, : , - . , , / , , - .js , , , ...
, , - , , , 60 , , ?
, , , "willy nilly"?