Home »
Code Examples »
Scala Code Examples
Scala - How to convert a Seq[A] to a Map[Int, A] using a value of A as the key in the map? Code Example
The code for How to convert a Seq[A] to a Map[Int, A] using a value of A as the key in the map?
val map = Map(seq map { a => a.key -> a }: _*)
Code by IncludeHelp,
on August 14, 2022 20:17