Open
Conversation
reneemeyer
suggested changes
Nov 13, 2017
reneemeyer
left a comment
There was a problem hiding this comment.
Good job, a couple of things to fix.
|
|
||
| // 3. | ||
| for (const keys in persons) { | ||
| console.log(Object.keys(persons)); |
There was a problem hiding this comment.
this would console.log every key in the persons array, for every key. You should just console.log(key)
| }; | ||
|
|
||
| // 3. | ||
| for (const keys in persons) { |
| } | ||
|
|
||
| // 4. | ||
| for (const keys in persons) { |
| // 1. When is a for loop better than a while loop? | ||
| // A for loop is better than a while loop when you know how many iterations there will be. | ||
| // 2. How is the readability of the code affected | ||
| The conditions in a for loop are clearly defined in the statement where as the while loop has less required conditions and therefor is easier to read and understand standalone, but is also more prone to errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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