Question: what is mapvalues in scala?
Answer: mapValues takes a function B => C , where C is the new type for the values. transform takes a function (A, B) => C , where this C is also the type for the values. So both will result in a Map[A,C] . However with the transform function you can influence the result of the new values by the value of their keys.