Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
val devNames = Map("dev1" -> "Smith", "dev2" -> "Mason", "dev3" -> "Carter", "dev4" -> "McCarthy")
val devDepartments = Map("dev1" -> "analytics", "dev2" -> "frontend", "dev3" -> "api", "dev4" -> "frontend")
val namesInDepartments = devNames.flatMap {
case (key, value) => devDepartments.get(key).map(_ -> value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.