Skip to content

Make basic_filter copy a little clearer #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions exercises/basic_filter/problem.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Task
Use Array#filter to write a function called `getShortMessages`.

`getShortMessages` takes an array of objects with '.message' properties and returns an array of messages that are *less than < 50 characters long*.
`getShortMessages` takes an array of objects with 'message' properties and returns an array of messages that are *less than < 50 characters long*.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this said "an array of messages as strings" I'd agree that this is clearer.


The function should return an array containing the messages themselves, *without their containing object*.

Expand All @@ -27,10 +27,12 @@ The function should return an array containing the messages themselves, *without
## Example

```
[ 'Tempor quis esse consequat sunt ea eiusmod.',
'Id culpa ad proident ad nulla laborum incididunt.',
'Ullamco in ea et ad anim anim ullamco est.',
'Est ut irure irure nisi.' ]
[ { message: 'Exercitation irure fugiat anim incididunt sunt duis deserunt laboris.' },
{ message: 'Eiusmod ipsum esse ullamco anim labore tempor eu nostrud commodo consequat consectetur amet.' },
{ message: 'Mollit ea labore do laboris nostrud proident ullamco.' },
{ message: 'Laboris excepteur aliquip ullamco culpa.' },
{ message: 'Culpa minim proident dolor ipsum ullamco est qui non aute aliquip excepteur sunt.' },
{ message: 'Cupidatat duis sit aute pariatur amet sit excepteur cupidatat.' } ]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect output though, the solution expects an array of strings, not an array of objects.

```

## Resources
Expand Down