Hey Roelof,

I don’t see you returning the results of your map anywhere. I would expect to 
see this:

  return messages.map( …

Best,
Scott


> On Jan 20, 2015, at 8:06 AM, Roelof Wobben <[email protected]> wrote:
> 
> Hello,
> 
> I try to learn functional javascript by following the functonial workshop of 
> nodeschool.
> 
> Now I have to filter out all the messages which lenght are shorter then 50.
> 
> So I thought this would work :
> 
> ~~~
> 
> module.exports = function getShortMessages(messages) {
> 
>     function small_message(item)
> 
>     { return item.length < 50 ; }
> 
> 
> 
>     messages.map(function(message)
> 
>      { return small_message(message) }) }
> 
> but when I test it I see a empty array as answer  
> 
> Can someone explain where my thinking took the wrong path ?
> 
> Roelof
> 
> 
> 
> 
> -- 
> Job board: http://jobs.nodejs.org/ <http://jobs.nodejs.org/>
> New group rules: 
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md 
> <https://gist.github.com/othiym23/9886289#file-moderation-policy-md>
> Old group rules: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> <https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/nodejs/2bb9460e-96ef-4160-98e5-afe713f6ea96%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/nodejs/2bb9460e-96ef-4160-98e5-afe713f6ea96%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/9B5E9C79-2121-43EA-81EA-E92DAA8D52A5%40apigee.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to