Arrays
- Arrays don't need to hold the same datatypes
- Arrays can be nested, you can have arrays in arrays
- Ex. myArray = [[true, false, 3, "three"], ["hello", 4], [0]]
- you can create objects with nothing in them
- var me = new Object();
- you can add to objects
myObj["name"] = "Charlie"; myObj.name = "Charlie";
- similar to arrays they are formatted
var myObj = { type: 'fancy', disposition: 'sunny' };
We will look at this in greater detail on Monday.
ReplyDelete