File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ You can define functions that returns a given integer + 1 like below.
59
59
(x: Int) => x + 1
60
60
```
61
61
62
- Left hand side of ` => ` is parameter(s) and right hand side of it is body.
62
+ Left hand side of ` => ` is parameter(s) and right hand side of ` => ` is body.
63
63
64
64
Notice that the function has no ` return ` keyword. This is because, in Scala, the last expression of the function is automatically returned.
65
65
@@ -84,7 +84,7 @@ val getTheAnswer = () => 42
84
84
println(getTheAnswer()) // 42
85
85
```
86
86
87
- If your function body spans across multiple lines, you can wrap them with ` {} ` .
87
+ If your function body spans across multiple lines, you must wrap them with ` {} ` .
88
88
89
89
```
90
90
val greet = (name: String) => {
You can’t perform that action at this time.
0 commit comments