Task number 5 says:
logTime() –use the same
name variable. There seems to be a problem with the scoping; we can tell by the amount of duplicate code here! In addition to variables scoped too broadly, duplicate code can indicate that a variable may be scoped too tightly.
Let’s avoid this repetition by adding
name as the first parameter for each function.
Why should I have to add
name as the first parameter? Maybe it’s easy but I still don’t get it.
Thanks for your help.