Fixed typo (#36048)

This commit is contained in:
Sanket Mishra
2019-05-17 15:16:43 +05:30
committed by Oliver Eyton-Williams
parent 4724c7f5d9
commit 5040c2e1ca

View File

@ -37,7 +37,7 @@ eventEmitter.emit(eventName, optionalData);
And the ability to attach a listener function and define the name of a specific event is done by `.on`. And the ability to attach a listener function and define the name of a specific event is done by `.on`.
```js ```js
eventEmitter.emit(eventName, callback); eventEmitter.on(eventName, callback);
``` ```
We will mimic the new functions we just learned about with an example. Create a new file called `eventemitter.js` and paste the following code: We will mimic the new functions we just learned about with an example. Create a new file called `eventemitter.js` and paste the following code: