File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function `map` which is available for collections in Scala.
2424{% tabs map_example_1 class=tabs-scala-version %}
2525
2626{% tab 'Scala 2 and 3' for=map_example_1 %}
27- ``` scala mdoc
27+ ``` scala
2828val salaries = Seq (20_000 , 70_000 , 40_000 )
2929val doubleSalary = (x : Int ) => x * 2
3030val newSalaries = salaries.map(doubleSalary) // List(40000, 140000, 80000)
@@ -42,7 +42,7 @@ an argument to map:
4242{% tabs map_example_2 class=tabs-scala-version %}
4343
4444{% tab 'Scala 2 and 3' for=map_example_2 %}
45- ``` scala mdoc:nest
45+ ``` scala
4646val salaries = Seq (20_000 , 70_000 , 40_000 )
4747val newSalaries = salaries.map(x => x * 2 ) // List(40000, 140000, 80000)
4848```
@@ -56,7 +56,7 @@ compiler can infer the type based on the type of function map expects (see [Curr
5656{% tabs map_example_3 class=tabs-scala-version %}
5757
5858{% tab 'Scala 2 and 3' for=map_example_3 %}
59- ``` scala mdoc:nest
59+ ``` scala
6060val salaries = Seq (20_000 , 70_000 , 40_000 )
6161val newSalaries = salaries.map(_ * 2 )
6262```
You can’t perform that action at this time.
0 commit comments