You question involves one language that supports overloading (the first one) and another that doesn't (JavaScript). That's going to make a succinct answer more difficult.
JavaScript doesn't do overloading. Not only doesn't it do overloading but it doesn't do typed parameters! It also doesn't do typed return values! A function can return nothing or something, dynamically, as it sees fit. There is virtually no compile time handling of parameter count, parameter types, and return type.
(TypeScript and/or other adds on top of JavaScript, to get the benefits of a static type system, so typos can be detected at compile time instead of by debugging.)
In JavaScript we can dynamically check the number of parameters passed, and/or check the dynamic types of the parameters, and/or see if an optional parameter was passed or not. And we can change the behavior one way or the other based on that.
the popular JavaScript library jQuery has many functions that do different things based on how many arguments they are passed
This mechanism here is optional parameters and optional return values, and programmers are varying behavior based on optional parameters presence or absence. We might call it sloppy polymorphism if we need a formal name for it. (It is not necessarily the authors of jQuery that are being sloppy but that this language offers optional parameters & optional return value as a substitute for overloading.)
This wouldn't work in some other languages: in general functions must return values and procedures cannot (aka void functions or methods) — we cannot dynamically change that. Since the return value is typed, you can't use an optional parameter to change the nature of the method (from function to procedure).
Further in other languages, optional parameters are passed as default value, which sometimes cannot be distinguished from not having been passed.
However, in some of those other languages, overloading is supported, and thus, functions with the same name and different count or types of parameters can coexist. These languages are typically doing compile-time selection (binding) of the appropriate overload to invoke, which is called ad-hoc polymorphism. I think that name is a bit too grand for what is just (compile-time) overloading; I don't see polymorphism of objects here, just two different functions that are available to choose from at compile time.
We should also mention that some languages support Variadic Functions (aka varargs), which allows a list or sequence of additional arguments. Usually at most one such list of additional args is allowed, and that list is positioned after any regular (non-varying) parameters. Typically, all the parameters in such varargs list share some common qualities, so can be thought of as a list of some type. This feature does not necessarily play well with optional parameters.