Implement Binary Search Algorithm

# Introduction In this challenge, we will implement a binary search algorithm. The goal of the lab is to write a function called `binarySearch` that takes a sorted integer array `nums` and a target value `target` and returns the index of the target value in the array. If the target value does not exist in the array, the function should return -1. The function must be implemented in the `binarySearch.js` file. The function is tested with different test cases, ensuring that all elements in `nums` are unique and the array size is between 1 and 10000, with element values ranging from -9999 to 10000.

|60 : 00

Click the virtual machine below to start practicing