From 8fc371f14e899fc9389ed98b20b9ee57e6b0886d Mon Sep 17 00:00:00 2001 From: Gabriel Enrique Ambrosini Cabrera Date: Fri, 23 Jan 2026 17:04:41 -0500 Subject: [PATCH 1/2] Unexpected output error fixed in an example (#42890) * Unexpected output error fixed in an example One line modified and one line added. The incrementDay function was intended to return a Date instance, as stated in the inline JS comment; however, it just returns a Unix time number. My small fix is returning the Date instance instead of returning the return value of the setDate method of Date. * Make example more real --------- Co-authored-by: Joshua Chen --- files/en-us/web/javascript/guide/using_classes/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From 8ee475f0fd4e606f1cb94b44eb5380d769c2452c Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Sat, 24 Jan 2026 02:08:08 +0100 Subject: [PATCH 2/2] Generator. Remove "hidden" from `Iterator` description (#42892) --- .../web/javascript/reference/global_objects/generator/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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