-
Notifications
You must be signed in to change notification settings - Fork 19
Homework 01 #16
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: main
Are you sure you want to change the base?
Homework 01 #16
Conversation
|
||
// Easier if it was | ||
// return super.render(); | ||
} |
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 class should inherit the render function in the parent class (do not override it, aka define it in DivElement).
Since DivElement
inherits from HTMLElement
, the render
function doesn't need to be defined. It's inherited from HTMLElement
. This would be an "override". See: https://javascript.info/class-inheritance#overriding-a-method
}, 1000); | ||
}; | ||
console.log(instance); | ||
instance -= 1; // the linter does not like "instance--". WTF? |
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.
The Airbnb lint rules probably disallowed this due to this weirdness in JavaScript with --
and spacing: https://eslint.org/docs/rules/no-plusplus
clearInterval(timerInterval); | ||
} | ||
start() { | ||
let instance = this.seconds; |
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.
Refactor the code to avoid assigning this to a variable.
instance
on line 9 could be replaced with this.seconds
. Although this technically meets the requirement in the README.
Week 1 HW Submission
Please fill out the information below in order to complete your assignment. Feel free to update this comment later if necessary.
Comfort rating on this assignment (1-5): 1|2|3|4|5
Comfort rating is 4
Completion rating on this assignment: complete|incomplete
Completion rating is "complete"
Your linter is evil. Tabs are supposed to be 4 spaces long, not the ungodly 2 spaces. For whatever reason, I convert
instance -= 1
toinstance--
, and the linter complains. They have made themselves an enemy today.