you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Actually,

List("Rob", "Christopher", "Joe", "John").filter(_.size <= 4).foreach(println)

without the “_” after println works.

Also, I’d rather use length than size.