Skip to content
Bhsd edited this page Apr 18, 2026 · 2 revisions

This is an internal document. For visitors, you can now go back to the home page.

// default (Node.js)
var findIndex = require("../util/search").default;
assert.strictEqual(
	findIndex([1, 2, 2, 2, 3], 2, (item, needle) => item - needle),
	2,
);
assert.strictEqual(
	findIndex([1, 3, 5, 7, 9], 2, (item, needle) => item - needle),
	1,
);

Clone this wiki locally