File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -229,10 +229,12 @@ if True:
229
229
/// array's first and last elements. If the array is empty, these properties
230
230
/// are `nil`.
231
231
///
232
- /// print(oddNumbers.first, oddNumbers.last, separator=", ")
232
+ /// if let firstElement = oddNumbers.first, lastElement = oddNumbers.last {
233
+ /// print(firstElement, lastElement, separator: ", ")
234
+ /// }
233
235
/// // Prints "1, 15"
234
236
///
235
- /// print(emptyDoubles.first, emptyDoubles.last, separator= ", ")
237
+ /// print(emptyDoubles.first, emptyDoubles.last, separator: ", ")
236
238
/// // Prints "nil, nil"
237
239
///
238
240
/// You can access individual array elements through a subscript. The first
@@ -241,7 +243,7 @@ if True:
241
243
/// the count of the array. Using a negative number or an index equal to or
242
244
/// greater than `count` triggers a runtime error. For example:
243
245
///
244
- /// print(oddNumbers[0], oddNumbers[3], separator= ", ")
246
+ /// print(oddNumbers[0], oddNumbers[3], separator: ", ")
245
247
/// // Prints "1, 7"
246
248
///
247
249
/// print(emptyDoubles[0])
You can’t perform that action at this time.
0 commit comments