Skip to content

Commit 45f089d

Browse files
committed
docs: correct parameter terminology in tic-tac-toe tutorial
Signed-off-by: Sebastian Legarraga <64795732+slegarraga@users.noreply.github.com>
1 parent c7d6b70 commit 45f089d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/content/learn/tutorial-tic-tac-toe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ JavaScript supports [closures](https://developer.mozilla.org/en-US/docs/Web/Java
11381138
11391139
</Note>
11401140
1141-
Now you can add X's to the board... but only to the upper left square. Your `handleClick` function is hardcoded to update the index for the upper left square (`0`). Let's update `handleClick` to be able to update any square. Add an argument `i` to the `handleClick` function that takes the index of the square to update:
1141+
Now you can add X's to the board... but only to the upper left square. Your `handleClick` function is hardcoded to update the index for the upper left square (`0`). Let's update `handleClick` to be able to update any square. Add a parameter `i` to the `handleClick` function that takes the index of the square to update:
11421142
11431143
```js {4,6}
11441144
export default function Board() {
@@ -2248,7 +2248,7 @@ body {
22482248
22492249
</Sandpack>
22502250
2251-
As you iterate through the `history` array inside the function you passed to `map`, the `squares` argument goes through each element of `history`, and the `move` argument goes through each array index: `0`, `1`, `2`, …. (In most cases, you'd need the actual array elements, but to render a list of moves you will only need indexes.)
2251+
As you iterate through the `history` array inside the function you passed to `map`, the `squares` parameter goes through each element of `history`, and the `move` parameter goes through each array index: `0`, `1`, `2`, …. (In most cases, you'd need the actual array elements, but to render a list of moves you will only need indexes.)
22522252
22532253
For each move in the tic-tac-toe game's history, you create a list item `<li>` which contains a button `<button>`. The button has an `onClick` handler which calls a function called `jumpTo` (that you haven't implemented yet).
22542254

0 commit comments

Comments
 (0)