mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 10:00:39 -04:00
fix(curriculum): typo in lecture working with loops transcript (#59315)
This commit is contained in:
@@ -89,7 +89,7 @@ for (const person of people) {
|
||||
}
|
||||
```
|
||||
|
||||
In this example, the we have an array of objects called `people`. Each object has a `name` and `age` property.
|
||||
In this example, we have an array of objects called `people`. Each object has a `name` and `age` property.
|
||||
|
||||
When we loop through the array, we create a variable called `person` that will represent the current object in the array.
|
||||
|
||||
@@ -97,7 +97,7 @@ Inside the loop, we are outputting a message to the console.
|
||||
|
||||
The first message will be `John is 30 years old`, the second message will be `Jane is 25 years old`, and the third message will be `Jim is 40 years old`.
|
||||
|
||||
`for...of` loops are really useful when you need to loop over values from an iterable like an array or a string. They also usually easy to read and can make your code more concise.
|
||||
`for...of` loops are really useful when you need to loop over values from an iterable like an array or a string. They are also easy to read and can make your code more concise.
|
||||
|
||||
# --questions--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user