Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30675

Re: some logic error on a map function

Path csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: some logic error on a map function
Followup-To poster
Date Fri, 17 Jun 2016 23:10:27 +0200
Organization PointedEars Software (PES)
Lines 37
Message-ID <2033046.3EF9NDWLXO@PointedEars.de> (permalink)
References <e46e5762-3e70-475d-93e7-d4ed92e9d3e7@googlegroups.com> <njtm7u$ug4$1@dont-email.me> <1898608.dsHlmFUGLj@PointedEars.de> <707175fc-85a5-44c8-8d81-08b2329594b9@googlegroups.com>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1466197828 9590 eJwFwYEBwDAEBMCVlHiM0xf2HyF3bvjQceA4vr4NlzCqalpdufOnc7PZg0ItqBSLps1VDh4cKxGV (17 Jun 2016 21:10:28 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Fri, 17 Jun 2016 21:10:28 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwNxtEBRDEEBMCWjrVEORL0X8K7+RrCxV+Y043Lrc2fNMpzTLsDWRcHR+5RlQr6PCgottC3iCs9xn+pOTsfR9wVYQ==
Cancel-Lock sha1:1MBETZht/watrq/tyltJ0xSvfHA=
X-NNTP-Posting-Host eJwNyskBwCAIBMCWkGPFcliU/ktI5j1hWOjtCHhMTK7kOGFQkX2ru2+zGiid1CzzI49/VyXP+wAmuxGH
Xref csiph.com comp.lang.javascript:30675

Followups directed to: poster

Show key headers only | View raw


[posted & mailed]

JRough wrote:

[yet another mindbogglingly stupid full-quote following an attribution 
novel]

> […] Thomas 'PointedEars' Lahn wrote:
>> [console.log() will then print “null” if there is no match in a sentence, 
>> a representation of an Array of matches (with duplicates) 
>> otherwise.  This can be refined to give, e.g. the index of the matches in
>> a sentence, by using RegExp.prototype.exec() in a loop instead of
>> String.prototype.match().]
> 
> I don't know what you mean about refining it to gie the index of the
> matches in the sentence?
>   console.log(sentences.map(function (sentence) {
>    // return sentence.match(rxBadWords);
>    var words = sentence.split(" ");
>    for (var i; i< words.length; i++){
>       rxBadWords.exec(words[i]);
>    }
> 
>   }));
> thankx,  this doens't work,

RTFM!

<http://www.catb.org/esr/faqs/smart-questions.html>

F'up2 poster

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

some logic error on a map function JRough <janis.rough@gmail.com> - 2016-06-15 20:23 -0700
  Re: some logic error on a map function Jake Jarvis <pig_in_shoes@yahoo.com> - 2016-06-16 09:58 +0200
    Re: some logic error on a map function "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-06-16 12:47 +0200
    Re: some logic error on a map function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-16 12:55 +0200
      Re: some logic error on a map function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-16 14:08 +0200
      Re: some logic error on a map function JRough <janis.rough@gmail.com> - 2016-06-16 11:04 -0700
      Re: some logic error on a map function JRough <janis.rough@gmail.com> - 2016-06-16 11:04 -0700
      Re: some logic error on a map function JRough <janis.rough@gmail.com> - 2016-06-17 13:30 -0700
      Re: some logic error on a map function JRough <janis.rough@gmail.com> - 2016-06-17 13:41 -0700
        Re: some logic error on a map function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-17 23:10 +0200
    Re: some logic error on a map function JRough <janis.rough@gmail.com> - 2016-06-17 13:31 -0700
      Re: some logic error on a map function Scott Sauyet <scott@sauyet.com> - 2016-07-03 03:07 +0000
        Re: some logic error on a map function JRough <janis.rough@gmail.com> - 2016-07-09 11:38 -0700

csiph-web