Path: csiph.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Functional Programming needs some real world use cases Date: Thu, 19 Jan 2017 21:16:36 +0100 Organization: PointedEars Software (PES) Lines: 22 Message-ID: <3131945.LM0AJKV5NW@PointedEars.de> References: <8b2dc802-a0d2-4ae0-ba75-98ecf5989e64@googlegroups.com> <87bmv2erpx.fsf@bsb.me.uk> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: solani.org 1484856997 27690 eJwFwYEBwCAIBLGVEORgHbXP/iM0yWDxapPsnByCaI2pL6tCymk3kBRnCn/fsuN+OWDFDxhZENY= (19 Jan 2017 20:16:37 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 19 Jan 2017 20:16:37 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNwoERwCAIBLCVQOHBcQDf/UdoL/ENxYTBYf78KZn45bopdHZ3lN4y05N6OEtmTCFeMjG9yQYfjnnUWvoBV5UVkA== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. justaguy writes: >> function forEach(array, action) { >> for (var i = 0; i < array.length; i++) >> action(array[i]); >> } >> >> forEach(["Wampeter", "Foma", "Granfalloon"], print); > > As an exercise, what expression can you write in place of "..." to print > all seven strings (and just those): > > forEach([["a","b","c"],["q","r"],["z"]], ...); Seven? -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.