Git Product home page Git Product logo

hyf-javascript3's People

Contributors

thwjason avatar

Watchers

 avatar

Forkers

elmira202003

hyf-javascript3's Issues

Feedback homework JS3 Week 1

Hi Jason, here is my feedback on your homework.

  1. The constructor of StaffMember takes a date as it third parameter, named dateOfBirth. You could do that like this:
    .addStar(new StaffMember("Ethan Hawke", "actor", new Date('6-11-1970'));
    The getAge() method should return an age in years. This could be done as follows:
    getAge() {
        const now = new Date();
        return now.getFullYear() - this.dateOfBirth.getFullYear();
    }
  2. The getDirector() method doesn't take a parameter. It doesn't set the director (otherwise it would have been called setDirector().
  3. Then you tried to call addRating() by chaining it to getDirector(). But that doesn't work because getDirector doesn't return the movie object itself (it doesn't return this). Anyway, what you are attempting to pass as an argument to addRating(), viz. this.rating = 64, isn't a rating at all (a movie rating is a number (of stars) between 0 and 10.

Some issues with the code referred to in trello

10/II/18 - 22:25

After a bit of a struggle, noding my thing yields the following code:

Movie {
  title: 'Gattaca',
  director: 'Andrew Niccol',
  stars: [],
  writers: [],
  rating: [] }
[ 'Ethan Hawke Age: 48',
  'Uma Thurman Age: 48',
  'Jude Law Age: 46' ]
Director: Andrew Niccol

I have tried to do the following within the code, and some variations thereto (and these are still left in the code):

//.addRating(this.rating = 64)
//.addWriter(new StaffMember("Andrew Niccol", "writer", Age: ${n - 1964}))

But whatever I do, I can't seem to push into the arrays. I am somehow not managing to either do a callback (which probably means my understanding here is deficient) to integrate the addStaff class into the Movie Class.

Any help at all would be appreciated.

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.