As Kenan mentioned, your approach is minimalistic but basically correct. Nevertheless, there a few remarks I can make.
Your repo is missing an .eslintrc.json file. Because of this ESLint is not checking your .js file.
You have a typo in line 7: whriters -> writers. You may have been warned by a green underline from the spell checker. Because you are not adding any writers, this error did not crop up at runtime.
The assignment asked to get the director's name by director.getName(). This hints that the director was supposed to be a StaffMember object, e.g.:
const myMovie = new Movie('anything', new StaffMember('anyone', 'director', 1979));
It would have been nice if you had added some code to test your getAverageRating() method.
Hi Anas, here is my feedback on your homework.
As Kenan mentioned, your approach is minimalistic but basically correct. Nevertheless, there a few remarks I can make.
.eslintrc.json
file. Because of this ESLint is not checking your.js
file.whriters
->writers
. You may have been warned by a green underline from the spell checker. Because you are not adding any writers, this error did not crop up at runtime.director.getName()
. This hints that the director was supposed to be aStaffMember
object, e.g.:getAverageRating()
method.