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


Groups > comp.lang.javascript > #30662

Re: some logic error on a map function

Newsgroups comp.lang.javascript
Subject Re: some logic error on a map function
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <e46e5762-3e70-475d-93e7-d4ed92e9d3e7@googlegroups.com> <njtm7u$ug4$1@dont-email.me>
Date 2016-06-16 12:47 +0200
Message-ID <XnsA629821F76E90eejj99@194.109.6.166> (permalink)

Show all headers | View raw


Jake Jarvis <pig_in_shoes@yahoo.com> wrote on 16 Jun 2016 in 
comp.lang.javascript:

> 
> The error message apparently is "Uncaught SyntaxError: Unexpected end of 
> input" and it is used by at least Chrome.
> 
> In Firefox the message is different: "SyntaxError: missing } after 
> function body".
> 
> Do you use an editor with syntax highlighting?
> 

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;}
  });
}; <<<<<<<<<<< MISSING } indeed!


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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