input: Write a function to calculate the product of each row in a 2D array.
  assert rowProduct([[1, 2], [3, 4]]) == [2, 12]
  assert rowProduct([[1, 2, 3], [4, 5, 6]]) == [6, 120]
  assert rowProduct([[2, 2], [2, 2], [2, 2]]) == [4, 4, 4]
output: def rowProduct(arr):
      result = []
      for row in arr:
          product = 1
          for num in row:
              product *= num
          result.append(product)
      return result