hyf-javascript3's People
Forkers
elmira202003hyf-javascript3's Issues
Feedback homework JS3 Week 1
Hi Jason, here is my feedback on your homework.
- The constructor of
StaffMember
takes a date as it third parameter, nameddateOfBirth
. You could do that like this:The.addStar(new StaffMember("Ethan Hawke", "actor", new Date('6-11-1970'));
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(); }
- The
getDirector()
method doesn't take a parameter. It doesn't set the director (otherwise it would have been calledsetDirector()
. - Then you tried to call
addRating()
by chaining it togetDirector()
. But that doesn't work becausegetDirector
doesn't return the movie object itself (it doesn't returnthis
). Anyway, what you are attempting to pass as an argument toaddRating()
, 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.