2 ms·
this also has some really fun rules that are useful for mad science sometimes. For example, you can recover the JS context's global value via this: (functi
by josephg 8y ago
this also has some really fun rules that are useful for mad science sometimes. For example, you can recover the JS context's global value via this:
(function() { return this })()
In a browser this resolves to the window object. In nodejs it resolves to the global object. I've used this a few times to help write isomorphic javascript bundles, though its much less useful than it once was.