Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/en-us/web/javascript/guide/using_classes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down