You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought of a super clean syntax for your great NPM library @jonschlinkert .
Usage
In case of single attribute sort: sort asc with string and desc with -+string
In case of multiple attribute sort: add the attributes in an array with the same asc/desc functionality as above
Examples
Single attribute reverse (desc) sort:
letarr=[{foo: 'y'},{foo: 'z'},{foo: 'x'}]arraySort(arr,'-foo')// Will sort on attribute `foo` as `desc`
Multiple attribute asc & desc sort:
letarr=[{foo: 'y',bar: 'a'},{foo: 'z',bar: 'b'},{foo: 'x',bar: 'c'},{foo: 'x',bar: 'a'}]arraySort(arr,['foo','-bar'])// Will sort on attribute `foo` as `asc`// will sort next on `bar` as `desc`
The text was updated successfully, but these errors were encountered:
I thought of a super clean syntax for your great NPM library @jonschlinkert .
Usage
string
and desc with-
+string
Examples
Single attribute reverse (desc) sort:
Multiple attribute asc & desc sort:
The text was updated successfully, but these errors were encountered: