Coder Social home page Coder Social logo

hyf_javascript3's People

Watchers

 avatar

hyf_javascript3's Issues

A suggestion

Regarding this line:

console.log(myMovie.getStars().map(actor => ${actor.getName()} ${actor.getRole()} ${actor.getAge()}));

Perhaps consider adding some spacing and punctuation so that the generated result is clearer.

Feedback Homework JS3 Week 1

Hi Diana, here is my feedback on your homework.

  1. Your repo is missing an .eslintrc.json file. Because of this ESLint is not checking you code. See VSCode Tips or the message I posted on slack on 6 Feb.
  2. In line 50, you forgot to declare the loop variable i. This error goes unnoticed when you run the code because you are not testing the getAverageRating() method. However as soon as you do you get a runtime error:
    /Users/jimcramer/hackyourfuture/class13/js3/diana/oop2.js:50
        for (i of this.ratings) {
             ^
    
    ReferenceError: i is not defined
    
    ESLint would have flagged this with a warning in VSCode.
  3. It would have been nice if you had added some code to test the getAverageRating() method, e.g.:
    myMovie.addRating(8);
    myMovie.addRating(7);
    console.log(myMovie.getAverageRating());
    
  4. In the assignment it was asked to get the director's name like this: director.getName(). This hints that the director was supposed to be a StaffMember object rather than just a string.
  5. You getAge() method assumes the current date is always 2018. Your code will no longer be accurate in 2019 and beyond. Maybe you can research how you can get the actual current year. Look up the documentation for the JavaScript Date object.

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.