diff --git a/doc/api/events.md b/doc/api/events.md index 49f706f5573364..9ee65388b682ce 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -1232,13 +1232,13 @@ import { getEventListeners, EventEmitter } from 'node:events'; const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); - getEventListeners(ee, 'foo'); // [listener] + console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); - getEventListeners(et, 'foo'); // [listener] + console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] } ``` @@ -1249,13 +1249,13 @@ const { getEventListeners, EventEmitter } = require('node:events'); const ee = new EventEmitter(); const listener = () => console.log('Events are fun'); ee.on('foo', listener); - getEventListeners(ee, 'foo'); // [listener] + console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] } { const et = new EventTarget(); const listener = () => console.log('Events are fun'); et.addEventListener('foo', listener); - getEventListeners(et, 'foo'); // [listener] + console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] } ```