diff --git a/.verb.md b/.verb.md index 9b5df34..13143a4 100644 --- a/.verb.md +++ b/.verb.md @@ -4,15 +4,19 @@ Sort an array by the given object property: ```js var arraySort = require('{%= name %}'); +// or for ES6 imports: +import arraySort from 'array-sort' -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'}] ```