3 ms·
Michael Bolin (author of Closure, definitive guide) gave a presentation advocating the use of "with" for a particular problem: http://bolinfest.com/talks/2011/j
by libria 14y ago
Michael Bolin (author of Closure, definitive guide) gave a presentation advocating the use of "with" for a particular problem: http://bolinfest.com/talks/2011/jsconf.us/#1 http://bolinfest.com/talks/2011/jsconf.us/#1
- isnotchicago 14y agoHow is the proposed usage (slide #8) different than the bad usage on slide #4 ("shorthand for setting multiple properties on an object")? The code for sharing module scope works fine as long as you stick with "a.i" instead of just "i" (i.e., are not lazy). As mentioned elsewhere, using `with` is very slow: http://jsperf.com/with-versus-without http://jsperf.com/with-versus-without