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

Duplicate.

Related articles:

Troubleshooting the Persistence of Local Argument Values in Method Calls
When using a method in a programming language, it is common practice to pass in arguments that are used within the method's code. Often, these arguments are local to the method, meaning they only exist within the method's scope and are not accessible outside of it. However, there are cases where local argument values can persist after the method call has ended, causing unexpected behavior and errors.

Understanding the Challenges of Default Argument Values in Methods
When writing code in modern programming languages such as Python, Ruby, and JavaScript, a common practice is to use default argument values in method definitions. This allows developers to specify a default value for an argument, which is used if the argument is not provided when the method is called.

Duplicate Significance: Method Fails to Pick Up Default Argument Values and Local Values Persist
Duplicate significance refers to a programming problem in which a method fails to pick up default argument values and local values persist. This problem can result in unexpected behavior in the program.