Hacker News new | ask | show | jobs
by JMTQp8lwXL 2118 days ago
Using an underscore for a variable name is perfectly fine when defining callback functions, where the underscore merely fills the void for the 1st parameter name, and you only need the 2nd parameter.
2 comments

So naturally, one should be sure to use underscore variables in all contexts except that one.
The convention in our codebase is quite simple: only use `_` as a name if you will ignore that parameter or value, and always use `_` when you will ignore that parameter or value.