Skip to content

Commit

Permalink
Merge pull request #38 from robbielane/master
Browse files Browse the repository at this point in the history
change _.where to _.filter
  • Loading branch information
mdunisch committed Jan 25, 2016
2 parents d5eb478 + b26cf73 commit 693574a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion exercises/1_getting_started/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ var testing = {
}
};

module.exports = verify(testing, run);
module.exports = verify(testing, run);
8 changes: 4 additions & 4 deletions exercises/1_getting_started/problem.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ aucun problème pour vous habituer à **Lo-Dash** !
## Allez, on s’y met

Commençons avec une fonction très fréquemment utilisée de **Lo-Dash**,
appelée `where` :
appelée `filter` :

```js
_.where(collection, props)
_.filter(collection, props)
```

`where` filtre `collection` en utilisant la condition définie par `props`.
`filter` filtre `collection` en utilisant la condition définie par `props`.
`collection` peut être n’importe quoi -- un `Array`, du JSON ou un objet Javascript.

## Exemple
Expand All @@ -33,7 +33,7 @@ var characters = [
{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
];

_.where(characters, { 'age': 36 });
_.filter(characters, { 'age': 36 });

// [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
```
Expand Down
8 changes: 4 additions & 4 deletions exercises/1_getting_started/problem.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
없으실 거예요.
* * *
## 해봅시다 ##
**Lo-Dash**에서 아주 자주 사용하는 `where` 함수로 시작해보죠.
**Lo-Dash**에서 아주 자주 사용하는 `filter` 함수로 시작해보죠.

```js
_.where(collection, props)
_.filter(collection, props)
```

`where``props`에 정의된 조건을 사용해 `collection`을 필터링 합니다.
`filter``props`에 정의된 조건을 사용해 `collection`을 필터링 합니다.
`collection`은 배열, JSON 데이터, JavaScript 객체 등이 될 수 있습니다.

#### 예제 ####
Expand All @@ -25,7 +25,7 @@ var characters = [
{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
];

_.where(characters, { 'age': 36 });
_.filter(characters, { 'age': 36 });

// [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
```
Expand Down
8 changes: 4 additions & 4 deletions exercises/1_getting_started/problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ heard of **[underscore.js](http://underscorejs.org/)**? **Lo-Dash** is a fork of
that's awesome. You definitely won't have any trouble with **Lo-Dash**!
* * *
## Down To Business ##
Let's start with a very often-used function in **Lo-Dash** called `where`:
Let's start with a very often-used function in **Lo-Dash** called `filter`:

```js
_.where(collection, props)
_.filter(collection, props)
```

`where` filters `collection` using the condition defined by `props`.
`filter` filters `collection` using the condition defined by `props`.
`collection` could be anything -- an Array, JSON data or a Javascript Object.

#### Example ####
Expand All @@ -24,7 +24,7 @@ var characters = [
{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
];

_.where(characters, { 'age': 36 });
_.filter(characters, { 'age': 36 });

// [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
```
Expand Down
2 changes: 1 addition & 1 deletion exercises/1_getting_started/solution/solution.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var _ = require("lodash");

var filterwhere = function (item) {
return _.where(item, {active: true});
return _.filter(item, {active: true});
};

module.exports = filterwhere;

0 comments on commit 693574a

Please sign in to comment.