My problem is the following:
I have a list of a specific type, lets call it A
.
A
is defined by A(name:String, value: Int)
.
This would make my list look like [("a", 10) ("b", 12) ("c" 14)]
.
Now I want to use a map function to extract only the secondary values. that is construct a new list of the values [10,12,14]
. I've been trying for over an hour but can't seem to get it working.
I've tried it with pattern matching in a map function and by trying to take the second element, i.e:
myList.map(_.value)
or
myList.map(_.2)
but can't seem to get it working.