Syntax Sunday Snobbery!
Some people are annoyed when I use x as a parameter name in the functions passed to functions such as filter, map or find:
let kittens = animals.find(x => x.type === 'cat' && x.ageMonths < 12)
Instead, they would prefer to write the variable name out:
let kittens =
animals.find(animal => animal.type === 'cat' && animal.ageMonths < 12)
I personally find the first example parses just fine, and just think of it as a pronoun. I.e.
"Where is the knife? I cannot find it. Do you have it?"
vs.
"Where is the knife? I cannot find the knife. Do you have the knife?"
You should not overuse this of course, as it might create obscure code in that case, but when the name of the array is very physically close to the x, I think it's perfectly legible. Observe the proximity of "x" and "animals" here:
animals.find(x => x.type === 'cat' && x.ageMonths < 12)
What do you think?
I prefer animal in that example for the fact that if tomorrow a coworker changes that simple logic to a much more complex one, he will probably keep the same variable name.