-
Notifications
You must be signed in to change notification settings - Fork 48
Time - Jocelyn #31
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: master
Are you sure you want to change the base?
Time - Jocelyn #31
Conversation
React Tic Tac ToeMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
kaidamasaki
left a comment
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.
Great job! Your code was very clean made excellent use of map and ternaries!
| if (winner === "In progress!") { | ||
| const newSquares = squares.map(row => | ||
| row.map(square => | ||
| square.id == [event.target.id] && square.value === '' ? |
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.
It looks like you used a == by accident here. Remember to pay attention to the warnings that you get in the terminal.
./src/App.js
Line 44:21: Expected '===' and instead saw '==' eqeqeq
| square.id == [event.target.id] && square.value === '' ? | |
| square.id === [event.target.id] && square.value === '' ? |
| const winCombo = [ | ||
| [0,1,2],[3,4,5],[6,7,8], | ||
| [0,3,6],[1,4,7],[2,5,8], | ||
| [0,4,8],[2,4,6] | ||
| ] |
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 is a really elegant way to solve this! Good job!
| const newSquares = squares.map(row => | ||
| row.map(square => |
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.
Excellent use of map here!
React Tic Tac Toe
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
useStateconnected?CS Fundamentals Questions
setState-- it must re-render all of the components that now have different content because of that change.What kind of data structure are the components in, and what sort of algorithms would be appropriate for React's code to "traverse" those components?
Speculate wildly about what the Big-O time complexity of that code might be.