Conversation
stu-k
left a comment
There was a problem hiding this comment.
#solidwork, just a couple notes here and there.
|
|
||
| // Use a for loop to console.log each item in the array carsInReverse. | ||
| const carsInReverse = ['Ford', 'Chevy', 'Tesla', 'Nissan', 'Toyota']; | ||
| for (i = 0; i < carsInReverse.length; i++) { |
There was a problem hiding this comment.
i is still a variable that hasn't been declared before, so you need to use let
| }; | ||
|
|
||
| // Use a for...in loop to console.log each key. | ||
| for (const keys in persons) { |
There was a problem hiding this comment.
Here, you're logging all keys (in an array) for every key, so [ 'firstName', 'lastName', 'birthDate', 'gender' ] gets logged four times. For the sake of the project, change keys to key (we don't have to, but just for clarity's sake since each key is only one key, not multiple), and also, just console.log(key), since Object.keys(...) is an array not a single value.
| } | ||
|
|
||
| // Use a while loop to console log numbers 1 to 1000 | ||
| let num = 1; |
There was a problem hiding this comment.
You define num as 1, which is fine, and you iterate through it in your wile loop, but then in your do loop, num is already 1000, so the do loop only runs once. Just reset num back to 1 after your while loop!
Checkpoint Rubric
This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.
Checkpoint 1
Checkpoint 2
Checkpoint 3