Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32198
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Functional Programming needs some real world use cases |
| Date | Thu, 19 Jan 2017 20:10:18 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 21 |
| Message-ID | <87bmv2erpx.fsf@bsb.me.uk> (permalink) |
| References | <8b2dc802-a0d2-4ae0-ba75-98ecf5989e64@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="2cdf34f8ad320d53510d792e611eaef0"; logging-data="28291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EBKuEo6ttYbuxfB50P+veXvmN5LfGXRY=" |
| Cancel-Lock | sha1:A3txNaFWYqgujYaT16tiozOa+Uk= sha1:9otCt3j5vzH4O6GbeOM0+mvCxv0= |
| X-BSB-Auth | 1.ece75958d781bcac23d7.20170119201018GMT.87bmv2erpx.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.javascript:32198 |
Show key headers only | View raw
justaguy <lichunshen84@gmail.com> writes:
> I'm starting to read about Functional Programming. The following is
> some sample code, which seems concise. In the meantime, I wonder if
> you have some idea of using other "action" other than "print", and of
> course, feel free to use other array "values" where appropriate.
>
> 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"]], ...);
--
Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-18 20:09 -0800
Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 20:10 +0000
Re: Functional Programming needs some real world use cases Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-19 21:16 +0100
Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 21:24 +0000
Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 12:34 -0800
Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 12:41 -0800
Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 13:01 -0800
Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 17:26 -0800
Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 21:23 +0000
Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 21:50 +0000
Re: [Firefox]"print" Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-24 01:52 +0100
Re: [Firefox]"print" Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-24 05:45 +0100
Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-20 04:28 +0000
Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 21:18 -0800
Re: Functional Programming needs some real world use cases John Harris <niam@jghnorth.org.uk.invalid> - 2017-01-20 10:22 +0000
Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-21 01:29 +0000
Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-21 01:15 +0000
Re: Functional Programming needs some real world use cases "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-01-21 15:00 -0800
Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-20 05:00 +0000
Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-20 05:02 +0000
csiph-web