Socket
Socket
Sign inDemoInstall

array-binarysearch.closest

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-binarysearch.closest - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

package.json
{
"name": "array-binarysearch.closest",
"version": "0.2.1",
"version": "0.2.2",
"description": "Get index of closest value in sorted array.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,8 +11,9 @@ # array-binarysearch.closest

// binarySearch(<array>, <value>, [compare function], [this], [begin=0], [end])
// -> <index of closest value>
binarySearch([21, 42, 91, 91], 40);
// 1
binarySearch([21, 42, 91, 91], 42, 2);
binarySearch([21, 42, 91, 91], 42, null, null, 2);
// 2
binarySearch([21, 42, 91, 91], 92, 2, 4);
binarySearch([21, 42, 91, 91], 92, null, null, 2, 4);
// 4

@@ -19,0 +20,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc