Im just confused in to why I get an error when I explicitly specify the type of: challenges. I know type inference can determine its an array. But why would get an error?
var walkingChallenges: [String] = ["Walk 3 miles a day", "Beat every day goal"]
var runningChallenges: [String] = ["Run 5 miles a day", "Beat everyday goal"]
var challenges: [String] = [walkingChallenges, runningChallenges]
error: cannot convert value of type string to expected element type string.
The right way is to simply write:
var challenges = [walkingChallenges, runningChallenges]
Thanks!