This feels like a dumb question, but here goes:
Consider the following to update a value of Int in a Map with a var of Int
var score: Int = _
val data = Map((
("things", "stuff") -> 0),
(("uwot", "stuff") -> 0),
(("isee", "stuff") -> 0))
data.map(element => {
if (element._1._2 == "stuff") {
score += 1
}
element._2 == score
})
In place of
element._2 == score
I've also tried
data(element._1).updated(element._1, score)
and
val result = data.get(element._1)
result == score
to no avail
Any pointers?