Amelia | PTBC2-2#40
Open
ameliawibi wants to merge 15 commits into
Open
Conversation
liam9408
reviewed
Jan 3, 2022
| let newDeck = []; | ||
|
|
||
| // Initialise an array of the 4 suit in our deck. We will loop over this array. | ||
| const suit = [ |
There was a problem hiding this comment.
Arrays are better named as plurals, and in the for loop it’s more clear to write something like for suit in suits 😉
liam9408
reviewed
Jan 3, 2022
| }; | ||
|
|
||
| // Add the new card to the deck | ||
| newDeck.push(card); |
There was a problem hiding this comment.
Is the deck meant to have double the amount of cards ?
liam9408
reviewed
Jan 3, 2022
|
|
||
| //timer & reset function | ||
| const countDown = () => { | ||
| handle = setInterval(function () { |
There was a problem hiding this comment.
I guess this is a very minor issue, but consistency is a highly valuable trait, if we have been using arrow functions throughout, it might be a good idea to use an arrow function here as well
liam9408
reviewed
Jan 3, 2022
| } | ||
| sec--; | ||
| //stop timer if time is out | ||
| if (minute === 0 && sec < 0) { |
liam9408
reviewed
Jan 3, 2022
liam9408
left a comment
There was a problem hiding this comment.
Very nice work ! The code is clean and very pleasant to read, minor issues on styling but we have plenty of time to fix those later on 🙂
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please fill out the survey before submitting the pull request. Thanks!
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
How many hours did you spend on this assignment? 2 days
Please fill in one error and/or error message you received while working on this assignment.
something is not a function (typeError)
Timer and reset is so tricky.
What part of the assignment did you spend the most time on? reset game without having to reload, styling, setInterval clearInterval.
Comfort Level (1-5): 3
Completeness Level (1-5): 5
What did you think of this deliverable? Challenging and fun
Is there anything in this code that you feel pleased about? The Christmas theme :) https://xmas-match-game.netlify.app/