From 5f8daa0121e4dfab1eb0d685226e669da0984e50 Mon Sep 17 00:00:00 2001 From: Risto McIntosh Date: Thu, 6 Feb 2020 21:44:02 -0600 Subject: [PATCH 1/2] Fixed a small typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 514956d..db2a4a2 100644 --- a/README.md +++ b/README.md @@ -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); ``` From c90b109b38fe6174c68f0c30d02b1b32149a5371 Mon Sep 17 00:00:00 2001 From: Risto McIntosh Date: Fri, 7 Feb 2020 08:12:47 -0600 Subject: [PATCH 2/2] Add an underscore to "Use explanatory variables" This makes the destructuring a little more readable --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db2a4a2..02c46fd 100644 --- a/README.md +++ b/README.md @@ -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); ```