Skip to content

Instantly share code, notes, and snippets.

@ifalok007
Created July 29, 2022 07:01
Show Gist options
  • Save ifalok007/dde32a1b7fb54243e161655aa077d599 to your computer and use it in GitHub Desktop.
Save ifalok007/dde32a1b7fb54243e161655aa077d599 to your computer and use it in GitHub Desktop.
val twentySomethings = for (user <- userBase if user.age >=20 && user.age < 30) yield user.name // i.e. add this to a list
twentySomethings.foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment