What am I doing wrong here? I am trying to get unique values in my array of objects. First time it gives -1 and 2nd time also it gives -1 and so it
-1