Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Logical conundrums if () else if() Date: Mon, 30 Dec 2019 21:35:41 +0100 Lines: 43 Message-ID: References: <0d26314f-6691-4428-90c9-b6a83828f776@googlegroups.com> <01ecacc6-d3a1-4a1e-a935-8c40837739bc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net N9KeyvU79/NN7lb6A1EDEAZ7KecTFdQo5Iwl2S9FSPTxBeu8ZZ Cancel-Lock: sha1:CuukHeJI4JNlp52SZeEreQQiqpU= In-Reply-To: <01ecacc6-d3a1-4a1e-a935-8c40837739bc@googlegroups.com> Xref: csiph.com comp.lang.javascript:37989 Jonas Thörnvall: > No i am more curious about how two code fragments that work perfectly > on their own with a "single if" can behave differently when connected > by an else if, i find that mysterious. Example: Assume ay is true. if (ay) { // will execute, since ay is true } if (ay) { // will execute, since ay is true } else if (ay) { // do something if ay } else { // do something else if a