Properties are like variables that belong to an object, and are used to hold pieces of information. Properties can be accessed in two ways:
Dot notation, with ObjectName.PropertyName
Bracket notation, withObjectName["PropertyName"] (don't forget the quotes!)
In the editor, we have brought back oursnoopy object, with a species and ageproperty.
Instructions
Set the global variable
species
to be snoopy's species and the variable age
to be snoopy's age. For one use dot notation and the other use bracket notation!
No comments:
Post a Comment