Skip to content

Commit

Permalink
Add an underscore to "Use explanatory variables"
Browse files Browse the repository at this point in the history
This makes the destructuring a little more readable
  • Loading branch information
ristomcintosh authored Feb 7, 2020
1 parent 5f8daa0 commit c90b109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ saveCityZipCode(
```javascript
const address = "One Infinite Loop, Cupertino 95014";
const cityZipCodeRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
const [city, zipCode] = address.match(cityZipCodeRegex) || [];
const [_, city, zipCode] = address.match(cityZipCodeRegex) || [];
saveCityZipCode(city, zipCode);
```

Expand Down

0 comments on commit c90b109

Please sign in to comment.