Update eventDispatcher.js

This code doesn't work
I gave up on this question.
I have no idea what I wrote, the syntax still feels weird to me :(
and the register method is never called from the outside.
and I didn't understand how the register method can send as a return value the same object as eventDispatcher !!