Skip to content

Commit 6f57ddc

Browse files
Add files via upload
1 parent 4e881c9 commit 6f57ddc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

indexeventm.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// F0 Let's simulate a subscription feature similar to YouTube. Using the events module, we'll create a custom event named "subscribe". When this event is triggered, it should display a message in the console indicating that the user has subscribed.
2+
const EventEmitter = require("events");
3+
const event = new EventEmitter();
4+
event.on("subscribe",(channelname)=>{
5+
console.log(`Thanks for subscribing to ${channelname}`);
6+
7+
8+
})
9+
event.emit("subscribe",'college wallah');

0 commit comments

Comments
 (0)