Skip to content

Class07 loops#9

Open
deytonk wants to merge 7 commits intogh-pagesfrom
class07-loops
Open

Class07 loops#9
deytonk wants to merge 7 commits intogh-pagesfrom
class07-loops

Conversation

@deytonk
Copy link
Owner

@deytonk deytonk commented Oct 31, 2017

Checkpoint Rubric

This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.

Checkpoint 1

  • All tests passed: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript: 30 points

Checkpoint 2

  • The application works as it should: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript and the DOM API: 30 points

Checkpoint 3

  • Use of React: 25 points
  • Accesses an API: 25 points
  • Proper use of documentation (commenting on code): 25 points
  • The application functions as it should: 25 points

Copy link

@reneemeyer reneemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, a couple of things to fix.


// 3.
for (const keys in persons) {
console.log(Object.keys(persons));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be key

}

// 4.
for (const keys in persons) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be key much more readable

// 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be commented out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants