Implement A Binary Search Algorithm In Javascript