Skip to content

Commit 54084ef

Browse files
authored
fix return
return may need to be an empty array, else if you: parse(""), it will raise TypeError
1 parent 45435ce commit 54084ef

File tree

1 file changed

+1
-1
lines changed
  • 5-regular-expressions/09-regexp-groups/5-parse-expression

1 file changed

+1
-1
lines changed

5-regular-expressions/09-regexp-groups/5-parse-expression/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function parse(expr) {
4141

4242
let result = expr.match(reg);
4343

44-
if (!result) return;
44+
if (!result) return [];
4545
result.shift();
4646

4747
return result;

0 commit comments

Comments
 (0)