dc-utils
This library was created following the series How to Write an Open Source JavaScript Library by @kentcdodds for egghead.io
Installation
npm install -g dc-utils
Usage
var dc = // check if an arraydc //truedc //false // sorting an arrayvar arr = 7 5 3 10 6 1 8dc // [1, 3, 5, 6, 7, 8, 10]dc // [] // sorting using a comparisson functionvar arr = first: 'daniel' last: 'cortes' first: 'tim' last: 'drake' first: 'bruce' last: 'wayne' first: 'kate' last: 'kane' arr // output:// [ { first: 'bruce', last: 'wayne' },// { first: 'daniel', last: 'cortes' },// { first: 'kate', last: 'kane'},// { first: 'tim', last: 'drake' }// ]
Attribution
The code used by this library was adapted from the book "Javascript: The Good Parts by Douglas Crockford."