not able to type underscore in question. The code snippet has underscore though.
why list.map(+2) works in place of list.map(x=>x+2) but list.map() doesnt work in place of list.map(x=>x)?
scala> val list = List(1,2,3,4)
list: List[Int] = List(1, 2, 3, 4)
scala> list.map(_+2)
res14: List[Int] = List(3, 4, 5, 6)
scala> list.map(x=>x+2)
res15: List[Int] = List(3, 4, 5, 6)
scala> list.map(x=>x)
res16: List[Int] = List(1, 2, 3, 4)
scala> list.map(_)
<console>:13: error: missing parameter type for expanded function ((x$1) => list.map(x$1))
list.map(_)
^
scala>