|
|
|
|
|
by tormeh
4069 days ago
|
|
Scala programmer here. class Container(val property:Int)
val list:List[Container]
val mappedlist:List[Int] = list.map(x=>x.property)
val option:Option[Container]
val mappedOption:Option[Int] = option.map(x=>x.property)
It works in exactly the same way... |
|