Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこのコードスニペットを持っています:
val ln = List (1, 2, 3) for (i <- ln){ println(i*2) }
List.foreachメソッドを使用して同じコードを書くことは可能ですか?
List.foreach
ln.foreach(i => println(i*2))