Welcome to the forums.
If you want to get technical about it, since JS is a case-sensitive language you’d want to avoid
String as that’s how the primitive and its constructor are identified.
string, all lowercase, isn’t strictly a reserved word… but may not be the best choice for the situation.
Personally it would make more sense to me to have the parameter
word, like so:
const logWord = word => console.log(word);
Doing this for the function in question works fine, as you have a single parameter - but if you had a more complex function which took more than one string, it may not be as useful to someone reviewing the code to have parameters named
string2, etc over a descriptive name reflecting their purpose within the function, e.g.
I’ve also dropped the
return, as since you’ve written a one-liner using arrow notation the
return is implied. (You may find that the function as you’ve written it also doesn’t work…)