Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Conversation

m4ndycheung
Copy link

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name: Mandy Cheung
  • Your City: Glasgow
  • Your Slack Name: Mandy Cheung

Homework Details

  • Module: JS1
  • Week: 2

Notes

  • What did you find easy?

  • Comparison and Logical Operators

  • The syntax is getting easier with practice!

  • What did you find hard?

  • Telling my brain to stop thinking about the most complicated way to solve problems (especially the reverseCount)

  • Testing my code works in these npm test files, asked a friend how to print it to the console

  • What do you still not understand?

  • Any other notes?

Copy link

@msimmdev msimmdev left a comment

Choose a reason for hiding this comment

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

Praise: Well done on these questions I found no issues in the answers given, just some suggestions and nitpicks.


function countReverse(number) {}
function countReverse(number) {
while (number >= 1) {

Choose a reason for hiding this comment

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

Suggestion: create a new variable that you can loop over and decrement rather than using the input number. e.g.

let currentNumber = number;
while (currentNumber  >= minNum) {
  console.log(number);
  currentNumber--;
}

The reason for this is you still have access to the unmodified user input in case you need to use it in a future modification of the function.
Also you'll find in the future lessons that for certain types passed to a function modifying the input data could have an impact on other parts of the program (this isn't a problem for integers though so wouldn't be an issue here)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, Michael, I think I need you to explain this a bit more to me over a buddy chat so I'll bring this up.

Took on Michael's feedback to write count = count + 1 in a shorter way
Took on Michael's feedback and added indentation to printOddNumbers.

Also declared a let variable for countReverse so that input data won't be modified
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants