Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rename state to zipCode to avoid confusion #118

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

Merged
merged 3 commits into from
Jan 13, 2017
Merged

Rename state to zipCode to avoid confusion #118

merged 3 commits into from
Jan 13, 2017

Conversation

vasanthk
Copy link
Contributor

@vasanthk vasanthk commented Jan 11, 2017

Pretty minor. But destructuring state using the regex was a little bit ambiguous since there is no state in the address (zip code instead).

Destructuring state using the regex was a little bit ambiguous since there is no state in the address (zip code instead).
@@ -102,16 +102,17 @@ setTimeout(() => {
**Bad:**
```javascript
const address = 'One Infinite Loop, Cupertino 95014';
const cityStateRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
const city
Regex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be erroneous line break here

@vasanthk
Copy link
Contributor Author

@vsemozhetbyt My bad. Fixed it.

@@ -102,8 +102,7 @@ setTimeout(() => {
**Bad:**
```javascript
const address = 'One Infinite Loop, Cupertino 95014';
const city
Regex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
const cityStateRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the Bad regex and Good regex don't match. We should make them the same variable.

Copy link
Owner

@ryanmcdermott ryanmcdermott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help! I added a comment.

@vasanthk
Copy link
Contributor Author

@ryanmcdermott Done!

@ryanmcdermott ryanmcdermott merged commit ab48c4c into ryanmcdermott:master Jan 13, 2017
@ryanmcdermott
Copy link
Owner

Woo hoo! Thank you Vasa!

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.

3 participants