Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.37 KB | None | 0 0
  1. //What is this gonna print?
  2. var numbers = [4, 7, 10, 99, 1, -3]
  3. numbers.sort {
  4.     return $0 < $1
  5. }
  6. print(numbers)
  7.  
  8.  
  9. // Is following code possible in swift?
  10. func myMethod<T: Equatable>(_ x: T, _ y: T) -> Bool {
  11.   return (x > y) ? true : false
  12. }
  13. myMethod("ray", "ray")
  14. myMethod(1, 1)
  15.  
  16. //Is this true or false?
  17. .none == nil
  18.  
  19. // What happen with
  20. print(1 == true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement