Skip to content
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: Remove unnecessary second argument in conditional statement #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mxmxmarexmxm
Copy link

This commit refactors the code by removing the unnecessary second argument in the conditional statement. The condition "if (obj[str[i]] && obj[str[i]] >= 1)" has been simplified to "if (obj[str[i]])" for improved readability and code conciseness. This change helps to streamline the logic and remove unnecessary complexity from the codebase.

This commit refactors the code by removing the unnecessary second argument in the conditional statement. The condition "if (obj[str[i]] && obj[str[i]] >= 1)" has been simplified to "if (obj[str[i]])" for improved readability and code conciseness. This change helps to streamline the logic and remove unnecessary complexity from the codebase.
Implemented the shortest approach to URLify a string. The URLify function utilizes the trim() method to remove leading and trailing spaces and the replaceAll() method to replace spaces with '%20'. This concise solution effectively replaces all spaces in the string with the desired URL encoding.
@mxmxmarexmxm mxmxmarexmxm changed the title refactor: Remove unnecessary second argument in conditional statement refactor: Remove unnecessary second argument in conditional statement and add URLify implementation Jun 15, 2023
@mxmxmarexmxm mxmxmarexmxm changed the title refactor: Remove unnecessary second argument in conditional statement and add URLify implementation refactor: Remove unnecessary second argument in conditional statement Jun 15, 2023
@mxmxmarexmxm mxmxmarexmxm reopened this Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant