First two have the same effect.
-
declare a variable
array1_OfStrings
, let it choose the type itself. When it sees[String]()
, it smartly knows that’s type array of string. -
You set the variable
array2_OfStrings
as type array of string, then you say it’s empty by[]
-
This is different because you just tell you want
array3_OfStrings
to be type array of string, but not given it an initial value.
I think the first one is recommended as The Swift Programming Language uses it more often.