Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

ternary operator swift

let a = 10

// Note that the space after the question mark
// is required! If you don't do this, the compiler
// will think you're trying to use optional chaining.
let result = a > 5 ? true : false // true
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ternary #operator #swift
ADD COMMENT
Topic
Name
3+1 =