Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did you know you can do this!?

  someObject.foo = function() {
    someObject.bar = 123;
  }

  function Foo() {
    var Foo = this;
    Foo.bar = 456;
  }
Pro tip: Always do asynchronous operations Before presenting the object to the program state. Or you will see "undefined" bugs in production!


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

Search: