mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): fix typos in 'Working with Loops' lecture (#62054)
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ Loops in programming are used to repeat a block of code multiple times.
|
||||
|
||||
An example of a loop would be when you are designing a program that needs to print out a list of items. You could use a loop to print out each one of the items in the list.
|
||||
|
||||
Another example would be when you designing a game and you want to move a character across the screen. You could use a loop to move the character a certain number of pixels each time the loop runs.
|
||||
Another example would be when you are designing a game and you want to move a character across the screen. You could use a loop to move the character a certain number of pixels each time the loop runs.
|
||||
|
||||
In JavaScript, there are several types of loops that you can use. In this lecture, we will cover the `for` loop. Here is the basic syntax for a `for` loop:
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ for (const prop in person) {
|
||||
}
|
||||
```
|
||||
|
||||
In this example have a custom function `isObject` that checks if the value is an object.
|
||||
In this example, we have a custom function `isObject` that checks if the value is an object.
|
||||
|
||||
The `Array.isArray` method is used to check if the value is an array. By placing the logical NOT operator (`!`) in front of the method, we are checking if the value is not an array.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user