binary-search

Guide: /guide/algorithms/binary-search

Signature

binarySearch(elements, searchElement);

Params:

NameTypeRequiredDefaultDescription
elementsArray<number>+
searchElementnumber+

Returns:

number | null - index of found element