I've been doing some experiments about high-order functions and decided to understand how to make an custom addEventListener function so to understand what's under the hood.
As you can see, it requires an 'event' parameter, but even though I'm not supplying at the second function, it works..
But here:
Yes, I get it, in vanilla JS the second function also works and coordinates gets undefined, but in this TypeScript code, first one works, second not.. I'm just confused.
Also, what's the right way to make an function's parameters optional, either insert params or empty.
Thanks for your time.
Edit: I think I'm looking for some kind of method overload like in java
public void someFunc(int a, int b)
public void someFunc(int a)
public void someFunc()
What's the equilavent of this in Js?