-
Notifications
You must be signed in to change notification settings - Fork 0
Jasyn Marais - JavaScript IV #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on the project. There's a merge conflict on the PR, fix and merge
| return `${student.name} receives a perfect score on ${subject}`; | ||
| } | ||
| randGrade(student) { // stretch | ||
| student.grade = Number(student.grade); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need mutating the object, you could create a new variable off of the student object, e.g let studentGrade = Number(student.grade)
| } | ||
| listSubjects() { | ||
| console.log(`${this.name} favourite subjects: ${this.favSubjects}`); | ||
| return `${this.name} favourite subjects: ${this.favSubjects}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
favSubjects is an array, to make it a list separated by a comma, you could use, this.favSubjects.join(',')
| drive(distance) { | ||
| if (this.canDrive) { | ||
| this.odometer += Number(distance); | ||
| return `Drove ${distance} miles. Odometer: ${this.odometer}.`; | ||
| } | ||
| return `I crashed at ${this.odometer} miles!`; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not conform with the instruction/spec
No description provided.