Skip to content

Function Overloading in JQuery Terminal? #951

Answered by jcubic
auki19 asked this question in Q&A
Discussion options

You must be logged in to vote

This has nothing to do with jQuery. JavaScript doesn't support of overloading. Only statically typed languages have this feature.

If you want a variable number of arguments, you create a single function. If the command does not have that argument, it will be undefined. But for it to work, you need option checkArity: false

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jcubic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants