Hacker News new | past | comments | ask | show | jobs | submit login

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.
    }
  });



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: