###Chapter 3: “Object Literals”

  • complex scripts can run to hundreds (even thousands) of lines. Programmers use functions, methods, and objects to organize their code.
  • Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. In an object, variables and functions take on new names.
  • IN AN OBJECT: VARIABLES BECOME KNOWN AS PROPERTIES, FUNCTIONS BECOME KNOWN AS METHODS
  • there are several way to create objects:
    • literal notation is the easiest and most popular way to create objects. var object = { key:value cheackAaialbility : function(){ return this.key - this.key; } };
  • you access the properties or methods of an object using dot notation.you can access properitis using square brackets.
    • var objectKey= object.key;
    • var objectKey= object[‘key’];