Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback homework week 2 #1

Open
remarcmij opened this issue Dec 28, 2017 · 1 comment
Open

Feedback homework week 2 #1

remarcmij opened this issue Dec 28, 2017 · 1 comment

Comments

@remarcmij
Copy link

Hi Jason, here is my feedback on your homework.

part01

  • There should be only one blank line at the end of your file.

part02

  • Very helpful that you included the error message and solution as comments in your file.

part03

  • In line 6 you have initialised the variable x with an empty string (let x = "";). To declare a variable without initialising it you would just do let x;.
  • Use at most one single blank line to separate blocks of code.
  • I see some missing semicolons.

part05

  • There is a bug in your code here. Suppose I change line 15 so that is reads:
let a = 10; //Math.round(z);
  • Clearly, a is now larger than z, but still the output lists the value of z (7.25) as the highest value. Can you fix this bug?
  • There is also another way of finding the highest of two numbers. Google for mdn math and see what you can find.

part06

  • Where is your empty array?
  • Instead of creating a new variable for Daan's favourite animal, can you add it to the existing array, i.e., favAnimals?
  • Be consistent in your use of upper- and lowercase. If you spell "Kiwi" and "Egret" with an initial capital, then do the same with "Baby Pig".
  • There is an unwanted space in " Egret".

part08

  • It is a standard practice to format if statements such that you start a new line after an opening brace and indent the block of code inside the braces, like this:
if (typeof foo === typeof bar) {
  console.log("Variables foo and bar are SAME TYPE");
}
else {
  console.log("Variables foo and bar are not SAME TYPE");
}
  • Remove the redundant blank lines at the end of the file.

part10

  • You are right that all bets are off in math when you are sucked into the black hole of infinity 😁

Bottom line: one bug to solve, some formatting issues, but overall: well done:

@thwjason
Copy link
Owner

My thanks; I have corrected the files in accordance to the comments herein (I hope).

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

No branches or pull requests

2 participants