Default Parameters
What happens when you use a function call with side effects as a default parameter?
When you use a function call with side effects as a default parameter, the function is called every time the outer function is called, but only if the parameter is missing or explicitly set to `undefined`. For example, in `function logTime(time = Date.now()) { console.log(time); }`, the `Date.now()` function (which has the side effect of retrieving the current timestamp) will be called each time `logTime()` is invoked without an argument. However, it won't be called if a value is provided: `logTime(1234567890)` would simply use the provided value. This lazy evaluation behavior is efficient, as potentially expensive operations are only performed when needed. However, it's important to be aware of this behavior when the default value function has side effects (like logging, modifying state, or making API calls), as these side effects will occur each time the default is applied, potentially leading to unexpected behavior if not properly accounted for in your design.