Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ea890e

Browse filesBrowse files
committed
Use destructuring assignment
1 parent 94e14be commit 6ea890e
Copy full SHA for 6ea890e

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎JavaScript/9-event-emitter.js

Copy file name to clipboardExpand all lines: JavaScript/9-event-emitter.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
const events = require('events');
3+
const { EventEmitter } = require('events');
44

5-
const emitter = new events.EventEmitter();
5+
const emitter = new EventEmitter();
66

77
emitter.on('new city', city => {
88
console.log('Emitted city:', city);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.