hyf-javascript3's People
hyf-javascript3's Issues
EMRE (Homework Feedback)
Hi Sam(Hisham).
Your code looks clear and neat. I run your code on my VS. It works. But i get some error from eslint. There are something which you defined but you never used.Two of them are value of your functions. I am not sure but this may create a problem when you call the function. Another thing about some of your functions.
For example:
addStar(star) {
this.stars.push(star);
}
You did not use return in this function. Is this something ok? Can we use "this" as a return. Because "this" also returns inside an array which is inside the constructor. And You do not get any error even you call your function.(myMovie.addStar(firstActor);).
addWriter(writer) {
this.**stars**.push(new StaffMember('Alfonso Cuarón', 'writer', '28-11-1961'));
}
getWriters() {
this.**stars**.writer;
}
This is the last thing which I don`t understand. Why did you use stars. As I know that we need to send the value inside the writer array which just defined in the constructor.
Thanks.
Feedback homework JS3 Week 1
Hi Sam, here is my feedback on your homework.
- Your
addWriters()
method take a parameterwriter
but you are not using it. Instead you have 'hard-coded' aStaffMember
in the body of the method. If I call your method with another writer as its parameter, your method will just push anotherAlfsonse Cuarón
. ForaddStar()
you are doing it correctly, why the difference? - Similar thing for
addMovie()
inStaffMember
. - The
getAge()
method ofStaffMember
is supposed to return an age (in years), not a birth date. - You correctly created a
StaffMember
object for themainDirector
but you do not use themyMovie1
movie you created with this director. Instead, you continue to use an earlier movie (myMovie
) where the director is still just a string. - It would be nice if you would have added some code to add a couple of ratings and tested whether your
getAverageRating()
method returned the right result. - You added an
index.html
file in which you load your.js
file, but you are not creating any HTML. - Your
.eslintrc.json
file should be in the root folder of your repo, not inweek1
orweek2
. And you should alway open the root folder of your repo in VSCode, not any subfolder.
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.