목록Fold (2)
Foggy day

알고 있으면 좋은 문법들에 대해 예제를 추가했습니다. 이중에서 spreadOperator는 특히 많이 사용되고, where도 필요에 따라서 많이 사용할 수도 있습니다. 어떠한 형태로 사용하는지 익혀두면 좋습니다. import 'dart:math'; // The imported package 'collection' isn't a dependency of the importing package. // 나올 경우 yaml -> dependencies -> collection: any 추가 import 'package:collection/collection.dart'; class Advanced { Advanced() { spreadOperator(); functionalProgramming(); whereSy..

Fold function have initial value. initial is 1 in this example. so, result of calFold is 25. But reduce function don't have initial value. so, result of calRecude is 24, because value of List position zero is 0. class KotlinPlayGroundActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_kotlin_pla..