@@ -154,12 +154,12 @@ as `[0-9]`.
154154| ` \S ` | A nonwhitespace character
155155| ` . ` | Any character except for newline
156156
157- So you could match a ((date)) and ((time)) format like 30-01 -2003
157+ So you could match a ((date)) and ((time)) format like 01-30 -2003
15815815:20 with the following expression:
159159
160160```
161161let dateTime = /\d\d-\d\d-\d\d\d\d \d\d:\d\d/;
162- console.log(dateTime.test("30-01 -2003 15:20"));
162+ console.log(dateTime.test("01-30 -2003 15:20"));
163163// → true
164164console.log(dateTime.test("30-jan-2003 15:20"));
165165// → false
@@ -255,7 +255,7 @@ is also slightly easier to decipher.
255255
256256```
257257let dateTime = /\d{1,2}-\d{1,2}-\d{4} \d{1,2}:\d{2}/;
258- console.log(dateTime.test("30-1 -2003 8:45"));
258+ console.log(dateTime.test("1-30 -2003 8:45"));
259259// → true
260260```
261261
@@ -424,8 +424,8 @@ millisecond count by creating a new `Date` object and calling
424424
425425Date objects provide methods like ` getFullYear ` , ` getMonth ` ,
426426` getDate ` , ` getHours ` , ` getMinutes ` , and ` getSeconds ` to extract their
427- components. Besides ` getFullYear ` , there's also ` getYear ` , which gives
428- you a rather useless two-digit year value (such as ` 93 ` or ` 14 ` ) .
427+ components. Besides ` getFullYear ` there's also ` getYear ` , which gives
428+ you the year minus 1900 ( ` 98 ` or ` 119 ` ), and is mostly useless .
429429
430430{{index "capture group", "getDate function"}}
431431
@@ -434,11 +434,11 @@ interested in, we can now create a date object from a string.
434434
435435```
436436function getDate(string) {
437- let [_, day, month , year] =
437+ let [_, month, day , year] =
438438 /(\d{1,2})-(\d{1,2})-(\d{4})/.exec(string);
439439 return new Date(year, month - 1, day);
440440}
441- console.log(getDate("30-1 -2003"));
441+ console.log(getDate("1-30 -2003"));
442442// → Thu Jan 30 2003 00:00:00 GMT+0100 (CET)
443443```
444444
@@ -1036,8 +1036,9 @@ usually called an _INI_ file) are as follows:
10361036- Anything else is invalid.
10371037
10381038Our task is to convert a string like this into an object whose
1039- properties hold strings for sectionless settings and sub-objects for
1040- sections, with those sub-objects holding the section's settings.
1039+ properties hold strings for settings written before the first
1040+ section header and sub-objects for sections, with those sub-objects
1041+ holding the section's settings.
10411042
10421043{{index "carriage return", "line break", "newline character"}}
10431044
0 commit comments