How to dispatch custom event?

I have coded a custom event but don’t know how to dispatch it in playcanvas. Can anyone there help me out?
var event1 = new CustomEvent(‘game_started’, { startTime: });

Hello @Hassan_Amjad,

there is a nice tutorial on emitting and receiving events.

Hi @Sebastian,
I am working for a client and he is demanding a custom event that are used in javascript.

Hi @Hassan_Amjad,

If you are creating custom JavaScript events then you should listen for them in your code using native JavaScript methods like addEventListener().