From 2fe1490d2799d4564436861cc723bea3c45d4f9c Mon Sep 17 00:00:00 2001 From: ruanyf Date: Sun, 30 Jul 2017 10:11:00 +0800 Subject: [PATCH] docs(object): edit object --- docs/object.md | 4 ++-- docs/regex.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/object.md b/docs/object.md index 9978632..77e1b71 100644 --- a/docs/object.md +++ b/docs/object.md @@ -1191,7 +1191,7 @@ let emptyObject = { ...null, ...undefined }; // 不报错 let aWithXGetter = { ...a, get x() { - throws new Error('not thrown yet'); + throw new Error('not throw yet'); } }; @@ -1200,7 +1200,7 @@ let runtimeError = { ...a, ...{ get x() { - throws new Error('thrown now'); + throw new Error('throw now'); } } }; diff --git a/docs/regex.md b/docs/regex.md index dba9010..0d3af56 100644 --- a/docs/regex.md +++ b/docs/regex.md @@ -367,7 +367,7 @@ JavaScript 语言的正则表达式,只支持先行断言(lookahead)和先 /\d+(?!%)/.exec('that’s all 44 of them') // ["44"] ``` -上面两个字符串,如果互换正则表达式,就会匹配失败。另外,还可以看到,”先行断言“括号之中的部分(`(?=%)`),是不计入返回结果的。 +上面两个字符串,如果互换正则表达式,就不会得到相同结果。另外,还可以看到,”先行断言“括号之中的部分(`(?=%)`),是不计入返回结果的。 “后行断言”正好与“先行断言”相反,`x`只有在`y`后面才匹配,必须写成`/(?<=y)x/`。比如,只匹配美元符号之后的数字,要写成`/(?<=\$)\d+/`。”后行否定断言“则与”先行否定断言“相反,`x`只有不在`y`后面才匹配,必须写成`/(?