Coder Social home page Coder Social logo

hyf-javascript1's People

Contributors

thwjason avatar

Watchers

 avatar

hyf-javascript1's Issues

Feedback homework week 2

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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.