checksort
v1.0.0
Published
A simple module to check if an Array is sorted
Downloads
1
Maintainers
Readme
checksort
check if an Array is sorted.
Example
const sorted = require('checksort')
console.log(checksort([1, 3, 5]))
// => true
console.log(checksort([2, 7, 0]))
// => false
// pass comparators
console.log(checksort([11, 5, 2], function (a, b) { return b - a }))
// => true