Is there a better way to do square in a list rather than this?
scala
Solution
Declare this once somewhere:
def sqr(x: Int) = x * x
And use it like this afterwards:
(1 to 10).map(sqr)
Problem
I am trying to simplify a square call. Is this the best way? ``` (1 to 10).map(x => x*x) ```