Skip to content

Commit 071dfdc

Browse files
authored
Use explanatory variables bad and good examples should match ([1] + [2] instead of [0])
1 parent bc1ae6a commit 071dfdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ for (var i = 0; i < MINUTES_IN_A_YEAR; i++) {
9595
**Bad:**
9696
```javascript
9797
let cityStateRegex = /^(.+)[,\\s]+(.+?)\s*(\d{5})?$/;
98-
saveCityState(cityStateRegex.match(cityStateRegex)[0], cityStateRegex.match(cityStateRegex)[0]);
98+
saveCityState(cityStateRegex.match(cityStateRegex)[1], cityStateRegex.match(cityStateRegex)[2]);
9999
```
100100

101101
**Good**:

0 commit comments

Comments
 (0)