johnfn
12/30/2018, 7:45 PMMike
12/31/2018, 2:28 PMlist.forEach(println(it))
will work.
The second is passing a function reference. The function (println) takes one parameter.
forEach takes a Lamda/function that accepts one parameter. So it is coded such that it calls the function with its parameter for you.
HTH