Skip to content

Commit b425522

Browse files
authored
Merge pull request #3526 from enarddpascua/source
fix/change parameter word to argument
2 parents 05dee0f + 76b135d commit b425522

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/3/en/part3c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ app.get('/api/notes/:id', (request, response, next) => { // highlight-line
771771
})
772772
```
773773

774-
The error that is passed forward is given to the <em>next</em> function as a parameter. If <em>next</em> was called without a parameter, then the execution would simply move onto the next route or middleware. If the <em>next</em> function is called with a parameter, then the execution will continue to the <i>error handler middleware</i>.
774+
The error that is passed forward is given to the <em>next</em> function as a parameter. If <em>next</em> was called without an argument, then the execution would simply move onto the next route or middleware. If the <em>next</em> function is called with an argument, then the execution will continue to the <i>error handler middleware</i>.
775775

776776
Express [error handlers](https://expressjs.com/en/guide/error-handling.html) are middleware that are defined with a function that accepts <i>four parameters</i>. Our error handler looks like this:
777777

@@ -899,7 +899,7 @@ app.put('/api/notes/:id', (request, response, next) => {
899899

900900
In the code above, we also allow the content of the note to be edited.
901901

902-
Notice that the <em>findByIdAndUpdate</em> method receives a regular JavaScript object as its parameter, and not a new note object created with the <em>Note</em> constructor function.
902+
Notice that the <em>findByIdAndUpdate</em> method receives a regular JavaScript object as its argument, and not a new note object created with the <em>Note</em> constructor function.
903903

904904
There is one important detail regarding the use of the <em>findByIdAndUpdate</em> method. By default, the <em>updatedNote</em> parameter of the event handler receives the original document [without the modifications](https://mongoosejs.com/docs/api/model.html#model_Model-findByIdAndUpdate). We added the optional <code>{ new: true }</code> parameter, which will cause our event handler to be called with the new modified document instead of the original.
905905

0 commit comments

Comments
 (0)