-
Notifications
You must be signed in to change notification settings - Fork 75
Amelia | PTBC2-2 #28
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?
Amelia | PTBC2-2 #28
Conversation
| const imgContainer = document.createElement("div"); | ||
| imgContainer.classList.add("image-container"); | ||
| document.body.appendChild(imgContainer); | ||
| const goStart = document.createElement("img"); |
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.
Can improve readability by separating each of the const declarations with an empty line
| let splitWatch; | ||
|
|
||
| // stopwatch time display | ||
| const renderTime = (element, elapsed) => { |
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.
nicely done ! 👍
| goStart.classList.add("img", "start"); | ||
| goStart.src = "/assets/play.png"; | ||
| imgContainer.appendChild(goStart); | ||
| const goStop = document.createElement("img"); |
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.
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") + " : "; |
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.
very nice use of padStart
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