@bemoje/arr-every
Returns true if the predicate is satisfied for every element of the passed array; otherwise false.
Returns true if the predicate is satisfied for every element of the passed array; otherwise false.
Determine whether an array is empty
Return the last element of an array where the callback returns true.
Linear-time Partitioning. Runtime: O(n). Chooses a pivot and re-arrages the array so that everything on the left is <= pivot and everything on the right is > pivot
Efficient in-place recursive sorting algorithm of numeric values. Avg. Runtime: O(n log n) | Worst: O(n^2)
Selection sort array
Sort an array considerably faster than the native Array.prototype.sort as a drop-in replacement. Fork of of the famous timsort module, but this module allows for passing comparator-builder options instead of a comparator function. In short, advanced compa
For a sorted array, add an element. Whichever comparator function was used to sort the array, can be passed. Also supports comparator-builder options. For reference, see: https://github.com/bemoje/bemoje-arr-sort-comparator
Binary search -based indexOf for sorted arrays.
Binary search -based indexOf for sorted arrays.
Iterate an array in reverse.
Retrieve all elements in provided indexes array.
Returns true if the element exists in the array
Return the index of the first element of an array where the callback returns true. Returns -1 if none do.
Returns all indexes at which an element is found.
Sorting by insertion - Look for bigger numbers on the left side. Runtime: O(n^2). It starts from the 2nd element, and it tries to find any element (to the left) that could be bigger than the current index. It will move all the elements that are bigger and
A npm pacakge of es6, it's a function of determinating a variable is an array or not.
Check if an object is empty
We are lazy, also [lazy-cache][]d and [browserify][]-ready - just arrayify, falsey values returns empty array. In bonus with `.isArray` method.
Most used utils, almost everywhere - [lazy-cache][]d. Including simple arrayify, [isobject][], [isarray][], [is-buffer][], [is-extendable][] and [extend-shallow][].