Skip to content

Conversation

@ristomcintosh
Copy link
Contributor

No description provided.

@jljorgenson18
Copy link

I don't think this is a typo. It's skipping the zero index value when destructuring because the first value matches the whole phrase "Cupertino 95014" instead of just the city or just the zip.

@ryanmcdermott
Copy link
Owner

If this feels like a typo then you're right! It's not readable enough. Maybe we should use an _ character to denote it is not used, much like Python and other languages do.

@ristomcintosh
Copy link
Contributor Author

ristomcintosh commented Feb 7, 2020

Ah I see. I think an _ would be more readable.

Edit*
I went ahead and added the change const [_, city, zipCode] = address.match(cityZipCodeRegex) .....

This makes the destructuring a little more readable
@ryanmcdermott
Copy link
Owner

Thanks that looks great!

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