How to binary search in JS

The binary search will search through a sorted dataset. It’s important that the data is sorted from the lowest…