Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: How can I make =?utf-8?B?4oCcaeKAnQ==?= from a main loop reflect the times that an inner loop inside that main loop runs Date: Wed, 14 Oct 2020 23:45:15 +0100 Organization: A noiseless patient Spider Lines: 17 Message-ID: <87y2k8qves.fsf@bsb.me.uk> References: <1660ec09-67d0-4224-b1b4-0a14023ae98dn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="deb11149bd21e87ca76219d17c479d7e"; logging-data="25400"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6Qd+MCBq/vGnZ2+bfs/Pl/6ihMpFB4Bw=" Cancel-Lock: sha1:sN5XwSygUWlWd1gmwUL/wzmrSgw= sha1:nrlQ++OUHLBr6/8TAsRRZBZkzO0= X-BSB-Auth: 1.40c88756f6a6c1a0d27f.20201014234515BST.87y2k8qves.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:38952 Diego Leonardo Robayo bernal writes: > Find the code here: > > https://stackoverflow.com/questions/64357143/how-can-i-make-i-from-a-main-loop-reflect-the-times-that-an-inner-loop-inside You'll get better answers if you post the code here. Try, also, to cut the example down. > How can I make the i in the main loop to reflect the times that the > loop inside typeDelay(i) ran. I think you have a bigger problem: the "main loop" is likely to have finished before any of the code triggered by setTimeout even runs. -- Ben.