Contact: aviboots(AT)netvision.net.il
41,157 questions
53,647 answers
573 users
val numbers = List(1, 2, 3, 4, 5, 6, 7, 8) val evenNumbers = numbers.filter(_ % 2 == 0) println(evenNumbers) /* run: List(2, 4, 6, 8) */
val words = List("Zephyr", "Quirk", "Luminous", "Wanderlust", "Serendipity", "Nebula") val longWords = words.filter(_.length > 6) println(longWords) /* run: List(Luminous, Wanderlust, Serendipity) */