How to check if array is empty in Swift

1 Answer

0 votes
var arr: [String] = []

if arr.isEmpty {
    print(true)
}

print(arr.isEmpty)

 

  
/*
run:

true
true
 
*/

 



answered Sep 2, 2020 by avibootz
...