ckeys
Return a compare function (to compare object's keys) to use in an Array's
.sort()
function
Installation
$ npm install --save ckeys
Usage
ckeys(key)
var ckeys = var array = text: 'a' num: 7 text: 'b' num: 1 text: 'c' num: 23 text: 'd' num: 79 array /* [ { text: 'b', num: 1 }, { text: 'a', num: 7 }, { text: 'c', num: 23 }, { text: 'd', num: 79 } ] */ array /* [ { text: 'd', num: 79 }, { text: 'c', num: 23 }, { text: 'a', num: 7 }, { text: 'b', num: 1 } ] */