Interesting question.
JavaScript is a "Loosely Typed" Language.
In programming, we call a language "loosely typed" when you don't have to explicitly specify types of variables and objects.
JavaScript is loosely typed. You don't have to tell that a string is a string, nor you can require a function to accept an integer as its parameter.
This gives JavaScript a lot of flexibility. Flexibility lets you move faster, change things quickly, iterate at a faster velocity.
One of the features of loosely typed language is that they auto initialize and typecast variables as required. Hence, when the JS interpreter reads the arguments and sees that one of the argument is missing, it automatically initializes it as undefined and continues with the further programming flow.
This is a concept which almost applicable to all loosely typed languages.
Thanks.