mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
fix(curriculum): add backticks in role playing game project (#48886)
Closes https://github.com/freeCodeCamp/freeCodeCamp/issues/48870
This commit is contained in:
parent
0126389f18
commit
593ca57c1e
@ -7,7 +7,7 @@ dashedName: step-62
|
||||
|
||||
# --description--
|
||||
|
||||
The `locations` array contains two locations: the town square and the store. Currently you are passing that entire array into the update functions. Pass in only the first element of the `locations` array by adding `[0]` at the end of the variable. For example: `myFunction(arg[0]);`.
|
||||
The `locations` array contains two locations: the `town square` and the `store`. Currently you are passing that entire array into the `update` function. Pass in only the first element of the `locations` array by adding `[0]` at the end of the variable. For example: `myFunction(arg[0]);`.
|
||||
|
||||
This is called <dfn>bracket notation</dfn>. Values in an array are accessed by index. Indices are numerical values and start at 0 - this is called zero-based indexing. `arg[0]` would be the first element in the `arg` array.
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user