I am new to the world of Javascript and am tinkering with writing very basic functions and stumbled upon the example below by accident and am unsure why it works when I am n
Because there's no error until the function expects to be able to work with the parameter that you're supposed to pass.
For example:
function myfunction(x) { return x*2; }
Would throw an error; albeit probably only a NaN (in this case) or a variable is undefined.
NaN
variable is undefined