Structured Arrays
You've already met the idea of
simple variables:
var price= 2.99;
And you also know about
arrays:
var fruit= ['apple', 'orange', 'lemon', banana'];
alert(fruit[1]); // displays 'orange'
And you've also been introduced to
objects (like MySprite) that let you bundle up all sorts of properties and methods.
It's also possible to make variables contain multiple properties, like this:
var fruit1= {name: 'banana', colour: 'yellow', price: 1.99};
var fruit2= {name: 'apple', colour: 'green', price: 1.49};
alert(fruit1.colour); // displays 'yellow'
The convenience of using structured variables makes it possible to write things like:
var breakfast = fruit1;
alert(breakfast.name); // displays 'banana'