Feature of using a function parameter as a variable the same name

If the function parameter has the same name as the external variable, then inside the function this parameter has a local scope and does not overwrite the external variable. Simply put, if a function variable has the same name as a function parameter or a local light green block, an error may appear that will not be easy to find.

%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

1 Like