Skip to content

HW1#11

Open
ilvhk2 wants to merge 2 commits into
frontend-application-development-uw20:masterfrom
chanjessica:master
Open

HW1#11
ilvhk2 wants to merge 2 commits into
frontend-application-development-uw20:masterfrom
chanjessica:master

Conversation

@ilvhk2
Copy link
Copy Markdown

@ilvhk2 ilvhk2 commented Apr 13, 2020

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): 5
  • Completion rating on this assignment: complete

// Define class here
class DivElement extends HTMLElement {
constructor(content) {
super(content);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
super(content);
super('div', content);

And then you don't need the next two lines.

const sTag = `<${this.tag}>`;
const eTag = `</${this.tag}>`;
const elem = sTag + this.content + eTag;
return elem;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider putting all this on one line.

});

console.log('****** Refactor the code to use object destructuring ******');
people.forEach((person) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
people.forEach((person) => {
people.forEach(({name, email, phone}) => {

Comment thread src/timer/Timer.js
start() {
// * Refactor the code to use `let/const`.
// * Refactor the code to avoid assigning `this` to a variable.
let instance = this.seconds;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to reference instance, you can just reference this.seconds

Comment thread src/timer/Timer.js
};
// * Refactor the code to use arrow function(s).
const timerInterval = setInterval(() => {
if (instance === 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (instance === 0) {
if (this.seconds === 0) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants