Learn how to use a Swift type called Booleans, which represent true or false values.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3535-programming-in-swift/lessons/6
Learn how to use a Swift type called Booleans, which represent true or false values.
This topic was automatically closed after 166 days. New replies are no longer allowed.
Error with this code
error: MyPlayground.playground:44:1: error: variables currently must have an initial value when entered at the top level of the REPL
let min: Int
^
let a = 50
let b = 10
let min: Int
if a < b {
min = a
} else {
min = b
}
min
However this works! let min = a < b ? a : b
@hb19xx The above code actually works in Xcode playgrounds. Do you still get errors when you run it in REPL?