js-binary-search

2.1.0 • Public • Published

js-binary-search

array

const bSearch = require('js-binary-search');
const array = [3, 5, 12, 56, 100];
bSeach.search(array, 12);
// return { index: 2, item: 12 }

associative_array

const bSearch = require('js-binary-search')
const array = [
  {id: 2},
  {id: 5},
  {id: 13},
  {id: 26}
]
bSeach.search_in_associative(array, 'id', 26)
// return {index: 3, item: {id: 26}}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    1
    • latest

Version History

Package Sidebar

Install

npm i js-binary-search

Weekly Downloads

1

Version

2.1.0

License

MIT

Last publish

Collaborators

  • komayuki