Array creation and type inference
📖 Scenario: You are organizing a small party and want to keep track of the guests' names using an array.
🎯 Goal: Create an array of guest names using Swift's type inference and then print the list.
📋 What You'll Learn
Create an array called
guestNames with exactly these names: "Anna", "Brian", "Catherine"Create a variable called
newGuest and assign it the value "David"Add
newGuest to the guestNames arrayPrint the
guestNames array💡 Why This Matters
🌍 Real World
Arrays are used to store lists of items like guest names, product lists, or scores in many apps.
💼 Career
Understanding arrays and type inference is essential for Swift developers building iOS apps that manage collections of data.
Progress0 / 4 steps