Discussion 議論
If the collection is empty, the value of this property is nil
.
コレクションが空であるならば、このプロパティはnil
です。
let numbers = [10, 20, 30, 40, 50]
if let firstNumber = numbers.first {
print(firstNumber)
}
// Prints "10"
Availability 有効性
Technology
var first: (T.Value
?, Range
<AttributedString
.Index
>)? { get }
If the collection is empty, the value of this property is nil
.
コレクションが空であるならば、このプロパティはnil
です。
let numbers = [10, 20, 30, 40, 50]
if let firstNumber = numbers.first {
print(firstNumber)
}
// Prints "10"