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

Skip to content

Commit 17512c3

Browse files
authored
Update README.md
1 parent 00a5068 commit 17512c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ saveCityZipCode(address.match(cityZipCodeRegex)[1], address.match(cityZipCodeReg
106106
```javascript
107107
const address = 'One Infinite Loop, Cupertino 95014';
108108
const cityZipCodeRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
109-
const [, city, zipCode] = address.match(cityZipCodeRegex);
109+
const [, city, zipCode] = address.match(cityZipCodeRegex) || [];
110110
saveCityZipCode(city, zipCode);
111111
```
112112
**[⬆ back to top](#table-of-contents)**

0 commit comments

Comments
 (0)