diff options
author | Divay Prakash <divayprakash@users.noreply.github.com> | 2020-01-24 20:32:12 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-24 20:32:12 +0530 |
commit | 16e416ab7f344c5aead6d3241ba38bcdb0d9b865 (patch) | |
tree | d44b9c3a8c1f56d3041d97c733e94f351ed74ce3 /swift.html.markdown | |
parent | db5a6f9fed1b1d4211f0764466d3c6fd68770f27 (diff) | |
parent | 88795664c5ff1980f41bfa39f853cef12f60e92e (diff) |
Merge pull request #3788 from bantic/patch-1
[swift/en] Return value of `findIndex` is `Optional<Int>`
Diffstat (limited to 'swift.html.markdown')
-rw-r--r-- | swift.html.markdown | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swift.html.markdown b/swift.html.markdown index 8582131a..689c5191 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -909,7 +909,7 @@ func findIndex<T: Equatable>(array: [T], valueToFind: T) -> Int? { } return nil } -findIndex(array: [1, 2, 3, 4], valueToFind: 3) // 2 +findIndex(array: [1, 2, 3, 4], valueToFind: 3) // Optional(2) // You can extend types with generics as well extension Array where Array.Element == Int { |