Binary search in JavaScript. A practical example
What is Binary Search?
If you have an array that you need to search, the easiest way might be to use indexOf() or maybe a for() loop. Each option will start on the left side of the field and iterate through each item in the field until the desired value is found.