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

'this' is also the same as exports. Initially, they all have the same value, they all point at the same object. If you assign module.exports to a new object (vs simply adding properties to the existing object) it will ignore the value of exports and this.

It's incredibly confusing and they should have just picked one way to export data, instead of three.



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

Search: