whichjs
v1.0.0
Published
Give an object of from an array.
Downloads
5
Readme
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
}
] */