1.0.0 • Published 1 year ago

whichjs v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

whichjs

Give an object of from an array

Usage/Examples

import { which } from "whichjs";

var array = [1, 2, 6, -5, 6, 0, 0, 5, -9, 9]; //array

var x = which(array, 0); // first one will be an array and second one is starting value

console.log(x);

// Return this in console
/* [
    {
        "more": 29,
        "less": -14,
        "morecount": 6,
        "lesscount": 2,
        "zeros": 2,
        "whole": 15
    }
] */