Skip to content

Commit 0fdc520

Browse files
authored
Merge pull request #104 from emma-burrows/patch-1
Clarify the purpose of getOrElse
2 parents b363a4d + c068be1 commit 0fdc520

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/stdlib/Options.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ object Options extends FlatSpec with Matchers with org.scalaexercises.definition
3535
* }
3636
* }}}
3737
*
38-
* Using `getOrElse` we can provide a default value ("No value") when the optional argument (`None`) does not exist:
38+
* Using `getOrElse`, we can extract the value if it exists, or return a provided default value. If we have a `Some(x)` we return `x`, and for `None` we return the default value.
3939
*/
4040
def getOrElseOptions(res0: String, res1: String, res2: String) {
4141
val value1 = maybeItWillReturnSomething(true)

0 commit comments

Comments
 (0)