r/learnjavascript • u/lindymad • Jan 22 '26
Is it possible to check if a function with a specific parameter signature(?) exists?
0
Upvotes
Just curious - I know I can check if a specific function exists with
if (typeof myFunction !== "undefined") ...Let's say myFunction could either be function myFunction() or function myFunction(parameter1), depending on which version of a library is loaded. typeof myFunction returns "function", is there a way to know if it's myFunction() or myFunction(parameter1)?
(Not sure if "parameter signature" is the right terminology)