From da14642ea15cb3c4943c5c2c0d40d360fca6f065 Mon Sep 17 00:00:00 2001 From: greggubarev Date: Tue, 16 Oct 2018 09:02:31 +0400 Subject: [PATCH] Javascript: Added hint to Match Whitespace (#19242) * Javascript: Added hint to Match Whitespace Added hint to Match (https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace and https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace/) * Update index.md --- .../match-whitespace/index.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace/index.md b/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace/index.md index 6c6d0fb8439..6d110ae9965 100644 --- a/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace/index.md +++ b/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace/index.md @@ -1,10 +1,17 @@ +--- +title: Match Whitespace --- -title: Match Whitespace ---- + ## Match Whitespace -This is a stub. Help our community expand it. +### Problem: -This quick style guide will help ensure your pull request gets accepted. +We need to change the regex ```countWhiteSpace``` to look for multiple whitespace characters in a string. - +### Solution: + +```js +let sample = "Whitespace is important in separating words"; +let countWhiteSpace = /\s/g; // Change this line +let result = sample.match(countWhiteSpace); +```