Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift 1 to n array

Use the ... notation / operator:

let arr1 = 0...4
That gets you a Range, which you can easily turn into a "regular" Array:

let arr2 = Array(0...4)
 
PREVIOUS NEXT
Tagged: #swift #array
ADD COMMENT
Topic
Name
9+9 =