Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created January 14, 2016 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjazdzewski1990/940c45e7d417aa007211 to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/940c45e7d417aa007211 to your computer and use it in GitHub Desktop.
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