Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <8042824.8LXobfXzMX@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 24 Sep 2012 01:14:53 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <505dfcdb$0$6848$e4fe514c@news2.news.xs4all.nl> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 18 NNTP-Posting-Date: 24 Sep 2012 01:14:53 CEST NNTP-Posting-Host: 8164538e.newsspool3.arcor-online.net X-Trace: DXC=`3L3Vc96[nGE4ZB2flKORAMcF=Q^Z^V3H4Fo<]lROoRA8kF […] With a closure you can hide variables and restrict their access to > predefined uses. The example of the counter, provided by Stefan, is such a > case. However, one should be aware that in addition to arbitrary execution order one is also sacrificing thread-safety this way the same as if the local variable was global: All calls to the returned function will use the same local variable of the returning outer function. PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16