Skip to content

Commit

Permalink
better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb authored Mar 5, 2018
1 parent a7913f8 commit d527bd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .verb.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ Sort an array by the given object property:
```js
var arraySort = require('{%= name %}');

arraySort([{foo: 'y'}, {foo: 'z'}, {foo: 'x'}], 'foo');
var arr = [{foo: 'y'}, {foo: 'z'}, {foo: 'x'}];
arraySort(arr, 'foo');
//=> [{foo: 'x'}, {foo: 'y'}, {foo: 'z'}]
```

**Reverse order**

```js
arraySort([{foo: 'y'}, {foo: 'z'}, {foo: 'x'}], 'foo', {reverse: true});
var arr = [{foo: 'y'}, {foo: 'z'}, {foo: 'x'}];
arraySort(arr, 'foo', {reverse: true});
//=> [{foo: 'z'}, {foo: 'y'}, {foo: 'x'}]
```

Expand Down

0 comments on commit d527bd0

Please sign in to comment.