3 ms·
It makes it more consistent with statements, and more convenient for one-liner functions (e.g. those that just delegate to another function). It's also somethi
by int_19h 4y ago
It makes it more consistent with statements, and more convenient for one-liner functions (e.g. those that just delegate to another function).
It's also something that was adopted by other languages in the curly braces family - e.g. C# originally required curly braces for function bodies, but now allows you to write:
int Sum(int x, int y) => x + y;