fix(learn): backslashes in description & hint text (#40801)
Correct example code in description and last hints text to match the last assertion test's actual and expected inputs. The string input with a single backslash throws an unterminated string constant error (single backslash starts a regex). No change to last assertion test as it was written correctly with a double backslash and passing as expected.
This commit is contained in:
@ -11,13 +11,13 @@ dashedName: split-a-character-string-based-on-change-of-character
|
||||
Split a (character) string into comma (plus a blank) delimited strings based on a change of character (left to right). Blanks should be treated as any other character (except they are problematic to display clearly). The same applies to commas. For instance, the string:
|
||||
|
||||
<pre>
|
||||
"gHHH5YY++///\"
|
||||
"gHHH5YY++///\\"
|
||||
</pre>
|
||||
|
||||
should be split as:
|
||||
|
||||
<pre>
|
||||
["g", "HHH", "5", "YY", "++", "///", "\" ];
|
||||
["g", "HHH", "5", "YY", "++", "///", "\\" ];
|
||||
</pre>
|
||||
|
||||
# --hints--
|
||||
@ -80,7 +80,7 @@ assert.deepEqual(split('sssmmmaaammmaaat'), [
|
||||
]);
|
||||
```
|
||||
|
||||
`split("gHHH5YY++///\")` should return `["g", "HHH", "5", "YY", "++", "///", "\\"]`.
|
||||
`split("gHHH5YY++///\\")` should return `["g", "HHH", "5", "YY", "++", "///", "\\"]`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(split('gHHH5YY++///\\'), [
|
||||
|
Reference in New Issue
Block a user