Skip to content

Commit

Permalink
addEventListener: Update example function name to prevent minor confu…
Browse files Browse the repository at this point in the history
…sion (mdn#30162)

The notes above this example teach that the second argument of the `addEventListener` function can accept an object that has a `handleEvent()` function. The example then shows what that might look like but names the function `eventHandler`.

This can cause a little bit of confusion so this PR just makes a minor rename to mitigate that.
  • Loading branch information
BuddyLReno authored Nov 10, 2023
1 parent 0121647 commit 59adb56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/api/eventtarget/addeventlistener/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ For example, an event handler callback that can be used to handle both
{{domxref("Element/fullscreenerror_event", "fullscreenerror")}} might look like this:

```js
function eventHandler(event) {
function handleEvent(event) {
if (event.type === "fullscreenchange") {
/* handle a full screen toggle */
} else {
Expand Down

0 comments on commit 59adb56

Please sign in to comment.