Develop a python function to locate a specific element in an array
[6, 2, 4, 8], 8
def find_element(arr, target): 
    for i in range(len(arr)): 
        if arr[i] == target: 
            return i 
    return -1