Question:
What's going on here? function handleMainEvent( elem: HTMLFormElement, handler: FormSubmitHandler ) function handleMainEvent( elem: HTMLIFrameElement, handler: MessageHandler ) function handleMainEvent( elem: HTMLFormElement | HTMLIFrameElement, handler: FormSubmitHandler | MessageHandler ) {}
Author: Kate WAnswer:
This is an example of function overloading. Two function heads or overload signatures are written above the body of the function and serve as multiple entry points to a single implementation.
0 / 5 Â (0 ratings)
1 answer(s) in total