Hi Kemirdin, here is my feedback on your homework.
Your get...() methods should just return the data without prefixing it with a string, like you did here:
return `Movie title: ${this.title}`;
it should just do this:
return this.title;
Why? Suppose I want to use your movie class in another application or web page and use Dutch as the main language. Then I would like to use the term Filmtitel. So, add such string information at the point where your are going to present the information to the user, e.g. in console.log or where you are creating an HTML element and set its innerHTML.
There can be more than one rating and more than one writer (these are arrays). So you should use a plural name: this.ratings, this.writers.
Class names should start with an uppercase letter: movieStaff -> MovieStaff
Similar as I have mentioned under point 1 above, the getStars() should just return this.stars. This is one reason why the code you commented out doesn't work. An other reason is that you forgot the parentheses after getAge. The correct code is:
Dear Sensei.
Thank you for your guidance and help, after your advice I have modified my code.now I can see my code is more readable and understandable.I really appreciated your feedback.
Hi Kemirdin, here is my feedback on your homework.
get...()
methods should just return the data without prefixing it with a string, like you did here:it should just do this:
Why? Suppose I want to use your movie class in another application or web page and use Dutch as the main language. Then I would like to use the term
Filmtitel
. So, add such string information at the point where your are going to present the information to the user, e.g. in console.log or where you are creating an HTML element and set itsinnerHTML
.this.ratings
,this.writers
.movieStaff
->MovieStaff
getStars()
should just returnthis.stars
. This is one reason why the code you commented out doesn't work. An other reason is that you forgot the parentheses aftergetAge
. The correct code is:director
is not an array. You can't use.map()
on it..eslintrc.json
file is invalid. The outer curly braces should be removed.