Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In kotlin you can also write:

    var name: String?
    // some code
    name?.let {
        // here name is not nil and can be accessed via variable "it"
    }
    // or 
    name?.let { name ->
        // here name shadows the previous variable, and is not nil
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: