define the regular expression to move the blank spaces around the string assigned to the variable ‘hello’:
You can use the following:
^ means the beginning of the string
\s means whitespace characters in regex
+ means 1 or more
| means OR (match the left side or the right side)
the g means "global" (match as many times as you can)
$ means the end of a string
....browse a bit to find out more about Regex...
So, the first part of the value assigned to your second variable in his challenge should look like:
/^\s+| ...try to define the second part by yourself
Then, apply the ‘replace’ method on the first variable ‘hello’ and assign the result to the variable ‘result’: