Fixed typo (#36048)
This commit is contained in:
committed by
Oliver Eyton-Williams
parent
4724c7f5d9
commit
5040c2e1ca
@ -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:
|
||||||
|
Reference in New Issue
Block a user