Last Index of Set and Array

Hello There is a set, an array. I want to get Last Index, they have the elements but the array shows 0, set shows -1 . Is it because of converting set into array? (I know Length, it’s a question about this weird thing).