Write a Python function to calculate the product of elements in a list.
[1, 2, 3, 4]
def product(arr):
    product = 1
    for num in arr:
        product *= num
    return product

product([1, 2, 3, 4])