Are there legitimate uses for JavaScript's "with" statement?

Posted by Shog9 on Stack Overflow See other posts from Stack Overflow or by Shog9
Published on 2008-09-14T18:54:32Z Indexed on 2010/04/04 4:23 UTC
Read the original article Hit count: 372

Alan Storm's comments in response to my answer regarding the with statement got me thinking. I've seldom found a reason to use this particular language feature, and had never given much thought to how it might cause trouble. Now, I'm curious as to how I might make effective use of with, while avoiding its pitfalls...

So my question is, where have you found the with statement useful?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about language-features