I started learning Scala but I found a confusing problem about map
. My code is like this:
val mymap = Map(1 -> "james",2 -> "justin")
println(mymap.view.mapValues(x => "hi" + x))
println(mymap.view.mapValues(x => x.toUpperCase))
but the result is
MapView(<not computed>)
MapView(<not computed>)
I am using view.mapValues
because .map
is deprecated. Any suggestion or doc I need to read about this?