timoxley / functional-javascript-workshop

A functional javascript workshop. No libraries required (i.e. no underscore), just ES5.
2.06k stars 441 forks source link

exercises basic_filter #167

Closed caoxiaoshuai1 closed 7 years ago

caoxiaoshuai1 commented 7 years ago

why the code below can't pass the workshop, I test it in other way but it works.

function getShortMessages(messages) {
   // SOLUTION GOES HERE
     return messages.filter(function(item) {
    return item.length < 50
  }).map(function(item) {
    return item
  })
 }

 module.exports = getShortMessages
timoxley commented 7 years ago

What's that second .map doing? What is the structure of the expected result

caoxiaoshuai1 commented 7 years ago

it's my fault, I misread the task