OBJECTS
by cliftonyeo
JavaScript
/*
var myObject
var person = { //creating an object
name:'bob',
occupation: 'builder',
build: function() {
alert("bob is building somefing!");
}
};
function write(msg) { //function that outputs "msg"
document.write(msg);
}
//"msg" is replaced by whatever is inside "write"
write(person.name + " works as a " + person.occupation);
write(person.build()); //use the parantheses () to call the function
*/
var treehouse = {
tree: "http://www.formfonts.com/files/1/9631/archicad-object-library-part-garden-tree-deciduous_small_FF_Model_ID9631_TreeDeciduous0411.jpg"