Scala 3, Programming Scala.
function passed to boundary.apply. It is synthesized from your block of code automatically when boundary.apply is called. Look at firstIndex again. If we do find an element that is equal to elem, then we call break to return the index i from the boundary. If we don’t find the element, then a