nv-array-find-index
v1.0.3
Published
nv-array-find-index =============== - nv-array-find-index
Downloads
4
Readme
nv-array-find-index
- nv-array-find-index
install
- npm install nv-array-find-index
usage
example
const ary_findi = require("nv-array-find-index")
var arr = [1,2,3,4,5]
var narr = ary_findi.all(arr,r=>r%2)
//[0,2,4]
var narr = ary_findi.all_not(arr,r=>r%2)
//[ 1, 3 ]
ary_findi.which(arr,1,r=>r%2)
//2
ary_findi.which(arr,5,r=>r%2)
//undefined
ary_findi.which_not(arr,1,r=>r%2)
//3
ary_findi.which_from_lst(arr,1,r=>r%2)
//2 5->4->3
ary_findi.fst(arr,r=>r%2)
//0
ary_findi.fst_not(arr,r=>r%2)
//1
ary_findi.lst(arr,r=>r%2)
//4
ary_findi.lst_not(arr,r=>r%2)
//3
ary_findi.some(arr,[0,2],r=>r%2)
//[0,4]
ary_findi.some_not(arr,[0,2],r=>r%2)
//[ 1 ]
ary_findi.some_not(arr,[0,1],r=>r%2)
//[ 1, 3 ]
ary_findi.some_from_lst(arr,[0,2],r=>r%2)
//[4,0]
ary_findi.some_not_from_lst(arr,[0,2],r=>r%2)
//[3]
ary_findi.some_not_from_lst(arr,[0,1],r=>r%2)
//[ 3, 1 ]
API
- ary_findi.fst(arr,cond_func,...other_params)
- ary_findi.fst_not(arr,cond_func,...other_params)
- ary_findi.lst(arr,cond_func,...other_params)
- ary_findi.fst_not(arr,cond_func,...other_params)
- ary_findi.which(arr,which,cond_func,...other_params)
- ary_findi.which_not(arr,which,cond_func,...other_params)
- ary_findi.which_from_lst(arr,which,cond_func,...other_params)
- ary_findi.which_not_from_lst(arr,which,cond_func,...other_params)
- ary_findi.some(arr,whiches,cond_func,...other_params)
- ary_findi.some_not(arr,whiches,cond_func,...other_params)
- ary_findi.some_from_lst(arr,whiches,cond_func,...other_params)
- ary_findi.some_not_from_lst(arr,whiches,cond_func,...other_params)
- ary_findi.all(arr,cond_func,...other_params)
- ary_findi.all_not(arr,cond_func,...other_params)
LICENSE
- ISC