On Mon, Oct 3, 2011 at 4:09 PM, Dave <dave1...@gmail.com> wrote: > What are people who are doing this using for var scoping of code?
Given that you can declare the var at the point of first use now, it's a lot easier to get it right: var n = arraylen(foo); for ( var i = 1; i <= n; ++i ) { ... } for ( var key in myStruct ) { ... myStruct[key] ... } for ( var elem in myArray ) { ... elem ... } Also, in ACF at least**, the tags that populate variables (cfquery, cfhttp etc) don't have script versions so the common error of forgetting to var them is reduced. **Railo has script versions of query, http etc so you need to remember to var declare the result variables there. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Railo Technologies, Inc. -- http://www.getrailo.com/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.