Hacker News new | ask | show | jobs
by tantalor 3844 days ago
Wow, the example is atrocious,

  Person.prototype.getAge = function (birthYear) {
    var age = 2015;
    age -= birthYear;

    return result;
    // Do you mean return age?
  };

  Object.defineProperty(Person.prototype, 'age', {
    get: function () {
      return this.getAge();
      // getAge function takes a required parameter.
    }
  });