const index = primitive
    ? arr.findIndex((item) => obj === item)
    : arr.findIndex((item) => obj[property] === item[property])