title: how to call a method in an object following the factory pattern
body: <p>I would like to display name, age, job in an alert message box, how do I do that?</p>
  
  <pre><code>function createPerson(name, age, job) {
      var o = new Object();
      o.name = name;
      o.age = age;
      o.job = job;
      o.sayName = function () {
          alert(this.name);
      };
      return o;
  }
  var person1 = createPerson('Nicholas', 29, 'Software Engineer');
  var person2 = createPerson('Greg', 27, 'Doctor');
  </code></pre>