<@U5SUR9W2D> perhaps the check should be even earl...
# getting-started
d
@veiset perhaps the check should be even earlier?
Copy code
fun avoidNullsEarly() {
    val map = HashMap<Int, Int>()
    fun plusOne(i: Int): Int = i + 1
    arrayOf(1, 2, 3)
        .filter { map[it] != null }
        .map { Pair(map[it]!!, it) }
        .map { plusOne(it.first) }
}