Path: csiph.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: some logic error on a map function Date: Thu, 16 Jun 2016 14:08:19 +0200 Organization: PointedEars Software (PES) Lines: 37 Message-ID: <5489482.L0yonRzWca@PointedEars.de> References: <1898608.dsHlmFUGLj@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1466078901 10236 eJwFwYEBwCAIA7CXRGgZ5yCu/59gAqdxMggGBBHfHFrW6PplKrNV2E1TzzmxfONXrUJ7Dx4j9RFt (16 Jun 2016 12:08:21 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 16 Jun 2016 12:08:21 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwYEBwCAIA7CXhEJl51iU/09YkqCxdzAZOTnLGfs5XpzaKku5wcucpchqfI1LVNzqe8SGFDpCeq+RfimPFU8= Cancel-Lock: sha1:T6BOkh22MJ4seXukY5qbr3c+zLw= X-NNTP-Posting-Host: eJwFwQERACAIA8BKcrApcYZC/wj+w2m8OwgGBnP8IOmyNNS24Yul7vaelSq7hXqem2ilxA8UXBFo Xref: csiph.com comp.lang.javascript:30664 Thomas 'PointedEars' Lahn wrote: > Jake Jarvis wrote: > [Pretty-printed code] Incompletely, therefore: >> > // Fill in function body here >> > var hasBadwords = function (message, index) { >> > var words = message.split(" "); >> > words.map(function (word,index) { >> > if (word == 'window' || word == 'chair' || word == 'knockings') { >> > return true; >> > } else { >> > return false;} ^ *There* is the first "missing" “}” … >> > } >> > ); > ^-- } … so this insertion is not necessary. >> > > ^-- }; However, this is. Still, it does not change the fact that the program logic is bogus, as I explained before. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.