Here you can find the source of isSparse()
Array.prototype.isSparse = function() { return this.length !== Object.keys(this).length; }
Array.prototype.isLastIndex = function(index) { return index == (this.length - 1);
Array.prototype.isMember = function (b) { return this.some(function (i) { return this == i }, b);
Array.prototype.isNFromLastIndex = function(index, n) { return (this.length - 1 - n) == index;
Array.prototype.isNothing = function() { return this.length === 0; };
'use strict'; Array.prototype.isNumberArray = function() { return !this.some(x => typeof x != 'number'); module.exports = function segmentNumbers(arr) { arr = arr.sort(); if (!arr.isNumberArray()) return []; let container = [], items = [], ...