Skip to content

Commit

Permalink
Merge pull request ryanmcdermott#149 from Endlessline/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmcdermott authored Jan 16, 2017
2 parents 89a0725 + 17512c3 commit 7dabe47
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 @@ -106,7 +106,7 @@ saveCityZipCode(address.match(cityZipCodeRegex)[1], address.match(cityZipCodeReg
```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);
```
**[ back to top](#table-of-contents)**
Expand Down

0 comments on commit 7dabe47

Please sign in to comment.