Objects

  • Objects can store related information about a thing
  • Properties can be added (and removed) over time
  • Objects can also be a lookup table
  • Be careful with storing in multiple places
const ryan = { name: "Ryan", age: 26, job: "Developer", id: "abc123" };
person.age ++;
delete person.name;
person.firstName = "Ryan";
person.lastName = "Kadri";

const employees = {};
employees[ryan.id] = ryan;
employees["abc123"] === ryan;

17 / 19