Can be useful in cases like this: ``` fun foo(...
# announcements
o
Can be useful in cases like this:
Copy code
fun foo(c: Boolean) {
        val bar : String
        if (c)
            bar = "foobar"
        else
            bar = "barfoo"
        println(bar)
    }
Though idiomatic here would be to use if-expression:
Copy code
val bar = if (c)
            "foobar"
        else
            "barfoo"