What is a generator expression in the following code?

for(i <- 1 to 10)
  println(i)
Explanation
A generator expression generates a series of values in a for expression. For example, in for(i <- 1 to 10), the generator expression is “1 to 10”.
Source: generator expression

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback