Skip to content

Commit 5ca89f9

Browse files
committed
Merge pull request nzakas#68 from joeeames/master
fixed a small error
2 parents 743f6ca + 96121c4 commit 5ca89f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manuscript/01-The-Basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ console.log(codePointLength("abc")); // 3
184184
console.log(codePointLength("𠮷bc")); // 3
185185
```
186186

187-
The regular expression in this example matches a both whitespace and non-whitespace characters, and is applied globally with Unicode enabled. The `result` contains an array of matches when there's at least one match, so the array length ends up being the number of code points in the string.
187+
The regular expression in this example matches both whitespace and non-whitespace characters, and is applied globally with Unicode enabled. The `result` contains an array of matches when there's at least one match, so the array length ends up being the number of code points in the string.
188188

189189
W> Although this approach works, it's not very fast, especially when applied to long strings. Try to minimize counting code points whenever possible. Hopefully ECMAScript 7 will bring a more performant means by which to count code points.
190190

0 commit comments

Comments
 (0)