Skip to content

Commit 87ce3dc

Browse files
authored
Update regexp.md (wangdoc#249)
补全 3.1 示例代码返回值~
1 parent ad7cd2b commit 87ce3dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/stdlib/regexp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ r.lastIndex = 4;
104104
r.test(s) // false
105105

106106
r.lastIndex // 0
107-
r.test(s)
107+
r.test(s) // true
108108
```
109109

110110
上面代码指定从字符串的第五个位置开始搜索,这个位置为空,所以返回`false`。同时,`lastIndex`属性重置为`0`,所以第二次执行`r.test(s)`会返回`true`

0 commit comments

Comments
 (0)