Later languages (for example, in C++) allow the programmer to specify default arguments that always have a value, even if one is not specified when calling the function.
The above-mentioned method is especially useful when one wants to set default criteria so that the function can be called with or without parameters.
Because default arguments' values are "filled in" at the call site rather than in the body of the function being called, virtual functions take their default argument values from the static type of the pointer or reference through which the call is made, rather than from the dynamic type of the object supplying the virtual function's body.
JavaScript's solution is not resolved statically (i.e. not at compile-time, which is why TypeScript models only the optionality and not the default values in the function's type signature) thus incurs additional runtime overhead, although it does provide more flexibility in that callbacks can independently control their defaults instead of centrally dictated by the (callback's type signature in the) type signature of the function which inputs the callback.
As with evaluation, in order to ensure the same extent as a local variable, one can use a sentinel value: