You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
leta=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(typeoffoo===typeofbar){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:
The text was updated successfully, but these errors were encountered:
Hi Jason, here is my feedback on your homework.
part01
part02
part03
x
with an empty string (let x = "";
). To declare a variable without initialising it you would just dolet x;
.part05
a
is now larger thanz
, but still the output lists the value ofz
(7.25) as the highest value. Can you fix this bug?mdn math
and see what you can find.part06
favAnimals
?"Kiwi"
and"Egret"
with an initial capital, then do the same with"Baby Pig"
." Egret"
.part08
if
statements such that you start a new line after an opening brace and indent the block of code inside the braces, like this:part10
Bottom line: one bug to solve, some formatting issues, but overall: well done:
The text was updated successfully, but these errors were encountered: