Welcome to the Treehouse Community
Looking to learn something new?
Below is a way to not name a function variable, but is it a best practice?
clockSection.textContent=getTime(); setInterval(() => clockSection.textContent=getTime(), 1000);
Would it be longer than just using:
, so that's why you wouldn't use it?
Steven Parker215,939 Points
Sure, it's shorter, but it also saves you from repeating the same assignment code. That's in keeping with the best-practice "DRY" (Don't Repeat Yourself) principle.
Also, when an arrow function contains more than just an expression (as this one has an assignment), you should use the "long form" where you place braces around the function body. In this case, you could also place parentheses around the assignment to cause it to be interpreted as an expression, but that's rather esoteric and not nearly as clear.