With Set you don't have to implement duplication control manually, it provides it to you for free. If you add the same value for the second time, Set will just ignore it, while with Array you'll have the duplicate and you'll have to add more code to handle this case.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
With
Set
you don't have to implement duplication control manually, it provides it to you for free. If you add the same value for the second time,Set
will just ignore it, while withArray
you'll have the duplicate and you'll have to add more code to handle this case.