Plants on the windowsill |
// for example:
var Jenny = { };
Each piece of information we include in an object is called a property. Each property has a name, followed by : and then the value of that property. For example, if we want to display my age, we'd type:
age: 18
we can access properties using two different methods: dot notation and literal notation.
// dot notation
var jenny = new Object();
jenny.username = "cutedork";
jenny.age = 18;
// literal notation
var jenny = {
username: "cutedork",
age: 18
};
Song of the day // Static Mind (Girl in a Coma)
No comments:
Post a Comment