Method not picking up default argument values and the local argument values persist between separate calls to the method

Scope issue.

Related articles:

Debugging Tips: How to Troubleshoot Method Issues with Default Argument Values
Debugging is a crucial skill for developers to have, and one of its most important aspects is the ability to troubleshoot issues with method arguments. Default argument values are a common source of method-related errors, but they can be easily resolved with the right approach.

The Mysteries of Local Argument Values in Methods: Explained
When it comes to programming, methods or functions are a key aspect. They are designed to perform specific tasks, taking in one or more arguments to complete the task at hand. However, sometimes the values of these arguments can be confusing, especially when they appear to be local.

Preventing Argument Value Persistence in Methods: Best Practices for Code Maintainability
In software development, one of the essential factors to consider is code maintainability. Code maintainability means that a codebase should be easy to understand, modify, and maintain in the long run. As every developer knows, it is not challenging to write code but understanding, modifying, and testing it is where the real issues arise.