Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2254161.6ScPoEuqDY@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 29 Jan 2014 15:39:11 +0100 User-Agent: KNode/4.11.3 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+&. MIME-Version: 1.0 Lines: 28 NNTP-Posting-Date: 29 Jan 2014 15:39:14 CET NNTP-Posting-Host: 1dbbcd77.newsspool2.arcor-online.net X-Trace: DXC=gXlKPeg:T6WcHPTNZh_e7QA9EHlD;3YcR4Fo<]lROoRQ8kFNkcP X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:22872 Bjoern Hoehrmann wrote: > So you need to consult documentation for the `setTimeout` function, say > > https://developer.mozilla.org/en/docs/Web/API/window.setTimeout#The_.22this.22_problem > > which says > > Code executed by setTimeout() is run in a separate execution context > to the function from which it was called. As a consequence, the this > keyword for the called function will be set to the window (or global) > object; it will not be the same as the this value for the function > that called setTimeout. You should not blindly believe everything you read. > So the correct answer is, for the problem case, "same as the value of > the `x` property on the global object". No, it is not. The correct answer is “depends”, as I have explained already. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.