Lambda (1) 썸네일형 리스트형 [Kotlin] High Order Function(고차함수) ✅High Order Function은 함수를 변수로 넘겨주거나 ,이를 반환하는 함수이다. 우선 Kotlin공식 문서의 예제를 한번 살펴보자. High-order functions and lambdas | Kotlin kotlinlang.org fun Collection.fold( initial: R, combine: (acc: R, nextElement: T) -> R ): R { var accumulator: R = initial for (element: T in this) { accumulator = combine(accumulator, element) } return accumulator } combine parameter는 (R, T) -> R 이라는 함수로 정의되어 있다. 즉, R과 T를 인자.. 이전 1 다음