-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
refactor: move to const variables and simplify conditionals #666
Merged
Conversation
This file contains 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
The variable "matched" has not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
In this commit, I tried to make the code more cleaner by: - using the spread syntax to simplify the Object.assign method. This combines the default classes with the settings classes using the spread operator to create a new object that contains all the properties. - using a loop and square brackets notation, to merge all properties in a dynamic way, instead of adding each one with a lot of duplicate code.
In this commit, I tried to make the code more cleaner by: - using "const" instead of "let" with unassignable functions. - using default parameter instead of using "if no options".
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variable has not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variable has not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
- The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment. - Using "slides.length > 0" is cleaner than "slides.length !== 0" because the second one means "(slides.length > 0) || slides.length < 0", and it can't be less than zero.
- The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment. - In line 92, we return if there is no item, so there is no need to check for item again in line 96. - in removeClass, we can simplify this if statement by using optional chaining operator.
The variable has not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
- Highlighting the difference between the two different statements by creating an object that contains both the symbols. - Using "includes" for a more dynamic and readable condition. - Using square brackets notation to avoid duplicate code.
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
- The variables have not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment. - Removing "NOT" from if statement to make it more readable.
The variable has not been reassigned a value, so it's better to use "const" instead of "let", to prevent any unexpected behavior that may occur due to unintended assignment.
jedrzejchalubek
changed the title
Review and refactor all files in src folder
refactor: move to const variables and simplify conditionals
Jul 18, 2023
Thanks! |
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.
No description provided.