ユーザー定義のコンストラクタ関数

ひな形だけ先に造っておいて、あとで中身を代入します。Personオブジェクトが、インスタンス化されているわけです。

var Person = function(living, age, gender){
  this.living = living;
  this.age = age;
  this.gender = gender;
  this.getGender = function() {
    return this.gender;
  };
};

var cody = new Person(true, 33, 'male');
console.log(cody);
var lisa = new Person(true, 34, 'female');
console.log(lisa);

console.log(cody.getGender());