So I am making a new topic. The solution as presented in forum post uses template strings:
.style('height', d => ${d}px)
But the challenge instructions do not mention the use of template strings, nor do any of the previous challenges. It works, but feels disconnected to the challenge. How would the user know to use a template string / string literal here?
Here is my solution that completes the challenge, and is more consistent with the instructions in this challenge and previous ones:
The instructions do not say you have to use a template literal, because you do not have to in order to solve the problem. That being said, users would have already learned about template literals in a preceding JavaScript section of the curriculum, so the solution seen in the guide should not confuse them.
If a user skips to the subsequent challenge it has a callback function written in the sample code. That tells me a callback function is what the author of the challenge intended.
I propose we add a second solution that includes a callback function.
The current solution does use a callback function (see below):
d => `${d}px`
That is a callback function, just like yours uses a callback function. The only difference is the template literal (current) vs. string concatenation (yours).
I agree with amartincastro. The solution does not follow what was taught in the previous lessons. There should be a second solution to keep a sanity check for people that do not know what is template literal is.