Skip to content

Commit 7c5d886

Browse files
committed
Clarify destructuring assignment
1 parent 32801a0 commit 7c5d886

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/content/1/en/part1b.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ console.log(first, second) // 1 2 is printed
122122
console.log(rest) // [3, 4, 5] is printed
123123
```
124124

125-
Thanks to the assignment, the variables _first_ and _second_ will receive the first two integers of the array as their values. The remaining integers are "collected" into an array of their own which is then assigned to the variable _rest_.
125+
Above, the variable _first_ is assigned the first integer of the array and the variable _second_ is assigned the second integer of the array. The variable _rest_ "collects" the remaining integers into its own array.
126126

127127
### Objects
128128

src/content/1/fi/osa1b.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ console.log(first, second) // tulostuu 1 2
125125
console.log(rest) // tulostuu [3, 4 ,5]
126126
```
127127

128-
Yllä muuttujiin _first_ ja _second_ sijoitetaan taulukon kaksi ensimmäistä lukua. Muuttujaan _rest_ "kerätään" sijoituksesta jäljelle jääneet luvut omaksi taulukoksi.
128+
Yllä muuttujaan _first_ sijoitetaan taulukon ensimmäinen luku ja muuttujaan _second_ taulukon toinen luku. Muuttujaan _rest_ "kerätään" sijoituksesta jäljelle jääneet luvut omaksi taulukoksi.
129129

130130
### Oliot
131131

0 commit comments

Comments
 (0)