I just remembered that I also do a sort of `Object.empty` in my own code 
somewhat frequently, as can be seen here for example:

https://github.com/getify/asynquence/blob/master/asq.src.js#L826

Declaring an empty object: `var ø = Object.create(null)`, and then using that 
`ø` as a sort of "global" DMZ object that I use for any place where I need a 
throw-away `this` binding, like `apply(..)`, `bind(..)`, etc.

I also wrote about that technique in "YDKJS: this & Object Prototypes", here:

https://github.com/getify/You-Dont-Know-JS/blob/master/this%20&%20object%20prototypes/ch2.md#safer-this

So, having an `Object.empty` might be nice in place of `ø`.




_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to