The main difference is that NSArray is an ordered collection and NSSet is an unordered list of unique elements.
Set
- Primarily access items by comparison
E.g let ingredients = [“Tea Powder”, “Sugar”, “Hot Water”, “Milk”, "Cardamom"]
if ingredients.contains(“Cardamom”) {
print(“It is Cardamom Tea”)
}
}
- unordered
- does not allow duplicates
Array
- Can access items by Index
- Ordered
- Allow duplicates
Awesome article I really impress it’s very informative and useful.Thanks
ReplyDeleteCustom Software Development Australia
Great post with unique information.This blog will really helpful for me to develop my skills in a right way.Thanks for sharing,keep update with your blogs.
ReplyDeleteWebsite Design Company in Bangalore | Mobile App Development Companies in Bangalore | Website Development Company in Bangalore
I appreciate this piece of useful information. CourseDrill academy one of the best leading Training Institute, provides the best Online services with expert Team. For more information visit our site:
ReplyDeleteOracle Fusion HCM Training
Workday Training
Okta Training
Palo Alto Training
Adobe Analytics Training