diff --git a/files/en-us/web/javascript/guide/using_classes/index.md b/files/en-us/web/javascript/guide/using_classes/index.md index d4576745deb4cb7..fe5b4b91001be6f 100644 --- a/files/en-us/web/javascript/guide/using_classes/index.md +++ b/files/en-us/web/javascript/guide/using_classes/index.md @@ -725,7 +725,7 @@ For example, one thing that makes `Date` objects infamous is that they're _mutab ```js function incrementDay(date) { - return date.setDate(date.getDate() + 1); + return new Date(date.setDate(date.getDate() + 1)); } const date = new Date(); // 2019-06-19 const newDay = incrementDay(date); diff --git a/files/en-us/web/javascript/reference/global_objects/generator/index.md b/files/en-us/web/javascript/reference/global_objects/generator/index.md index 082e915c506c92b..586087fdaccc158 100644 --- a/files/en-us/web/javascript/reference/global_objects/generator/index.md +++ b/files/en-us/web/javascript/reference/global_objects/generator/index.md @@ -8,7 +8,7 @@ sidebar: jsref The **`Generator`** object is returned by a {{jsxref("Statements/function*", "generator function", "", 1)}} and it conforms to both the [iterable protocol](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) and the [iterator protocol](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol). -`Generator` is a subclass of the hidden {{jsxref("Iterator")}} class. +`Generator` is a subclass of the {{jsxref("Iterator")}} class. ## Constructor