We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
You can generally eliminate a lot of if/else boilerplate by leveraging the fact that the strict equality comparison (===) will return a boolean.
if
else
===
E.g. you could replace this:
b-b/src/components/questionContainer/index.js
Lines 11 to 15 in e6b0f97
with just
setCorrect(answer === correct_answer);
The text was updated successfully, but these errors were encountered:
Similarly to Oli, I noticed you were using a string "correct" as the initial value for your state: https://github.com/FAC-Sixteen/b-b/blob/master/src/components/questionContainer/index.js#L9 When the type of the state is always going to be a boolean, it's a good idea to initialise it to a boolean too :) In this case false would had been a good initial state.
string
false
Sorry, something went wrong.
No branches or pull requests
You can generally eliminate a lot of
if
/else
boilerplate by leveraging the fact that the strict equality comparison (===
) will return a boolean.E.g. you could replace this:
b-b/src/components/questionContainer/index.js
Lines 11 to 15 in e6b0f97
with just
The text was updated successfully, but these errors were encountered: