input: Write a function named binarySearch that takes two parameters: an array and a target value. The function should implement a binary search algorithm to determine if the target value is present in the sorted array. If the target value is found, return True; otherwise, return False. Include assert statements to test the function with various inputs and the expected outputs.
  
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 5) == True
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 8) == False
  assert binarySearch([], 5) == False
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 1) == True
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 7) == True
output: def binarySearch(arr, target):
      left, right = 0, len(arr) - 1
      while left <= right:
          mid = (left + right) // 2
          if arr[mid] == target:
              return True
          elif arr[mid] < target:
              left = mid + 1
          else:
              right = mid - 1
      return False