Challenge Set A: We all scream for ice cream

Rewrite the IceCream structure below to use default values and lazy initialization:

struct IceCream { let name: String

let ingredients: [String]

}

  1. Change the values in the initializer to default values for the properties.
  2. Lazily initialize the ingredients array.

results matching ""

    No results matching ""