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

I like how you illustrate in a clear way something that is unintuitive for people coming from a more traditional class-based background; the scoping of this.

It's easy to see how it applies locally to descendants of the original object, such as here:

  var person = Object.create(null);
  defineProperty(person, 'fullName', function() {
    return this.firstName + ' ' + this.lastName;
where neither fullname nor person even have those properties, but their descendents do.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact