In earlier versions of Scala you can use List.make(100, 1), but that is now deprecated. What is the new proper way to do it?
Asked
Active
Viewed 1,902 times
2 Answers
19
As described in the deprecated note:
@deprecated("use `fill' instead", "2.8.0")
try this:
List.fill(100)(1)
Tomasz Nurkiewicz
- 311,858
- 65
- 665
- 652