Run to execute this JavaScript code for real (output appears here).
Ready.
Searches a sorted array by repeatedly comparing the target with the middle element and discarding the half that cannot contain it. Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.
Step
1 / 17
Line (JavaScript)
—
main (no active function frames)
No counted operations yet.
[2, 5, 8, 12, 16, 23, 38, 56, 72, 91]