Created
February 11, 2016 14:01
-
-
Save jplazcano87/32ee4cc419a5ad14f0f1 to your computer and use it in GitHub Desktop.
Ternanry operator in swift 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a:Int? | |
let b = 2 | |
var output:Int? | |
//a is nil here | |
output = a ?? b | |
print("Value of Output is \(output!)") | |
//a is assigned value of b | |
a = 1 //Assigning Value to a | |
output = a ?? b | |
print("Value of Output is \(output!)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment