Skip to content

Conversation

@ameliawibi
Copy link

Please fill out the survey before submitting the pull request. Thanks!

🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀

How many hours did you spend on this assignment? long. about 2 days

Please fill in one error and/or error message you received while working on this assignment.
Something is not a function

What part of the assignment did you spend the most time on?
Split and renderTime

Comfort Level (1-5): 3

Completeness Level (1-5): 4.5

What did you think of this deliverable? Split function is very tricky. I think its a good practice to use Date.now() for timer as opposed to normal increment

Is there anything in this code that you feel pleased about? Date.now() and renderTime

@ameliawibi ameliawibi changed the title Amelia | PTBC2 Amelia | PTBC2-2 Dec 4, 2021
const imgContainer = document.createElement("div");
imgContainer.classList.add("image-container");
document.body.appendChild(imgContainer);
const goStart = document.createElement("img");

Choose a reason for hiding this comment

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

Can improve readability by separating each of the const declarations with an empty line

let splitWatch;

// stopwatch time display
const renderTime = (element, elapsed) => {

Choose a reason for hiding this comment

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

nicely done ! 👍

goStart.classList.add("img", "start");
goStart.src = "/assets/play.png";
imgContainer.appendChild(goStart);
const goStop = document.createElement("img");
Copy link

@liam9408 liam9408 Dec 21, 2021

Choose a reason for hiding this comment

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

I think you can simply name these variables as startTimer, stopTimer, or even startButton, stopButton ... etc. This is to provide super clear context of what each button does.


//concat all the units above
let text = "";
text += hours.toString().padStart(2, "0") + " : ";

Choose a reason for hiding this comment

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

very nice use of padStart

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.

2 participants