Back to Developer Roadmap

By-name parameters

src/data/roadmaps/scala/content/by-name-parameters@_GMHFAt8BulTAb9msdUb9.md

4.0707 B
Original Source

By-name parameters

By-name parameters are defined using the => symbol before the parameter type. Such a parameter will be evaluated only when it is used inside the method's body. You can think of it as syntactic sugar over a zero-parameter function passed to a method.

Visit the following resources to learn more: