UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

10 lines (9 loc) 371 B
import { pythonBisect } from "../_helpers/_bisect.js"; export function bisect(a, x, lo, hi) { // discuss at: https://locutus.io/python/bisect/bisect/ // parity verified: Python 3.12 // original by: Kevin van Zonneveld (https://kvz.io) // example 1: bisect([1, 2, 2, 4], 2) // returns 1: 3 return pythonBisect(a, x, lo, hi); }