What's the use case for this? I don't see why you'd have an argument to a function that you never use in the function. Why not just remove the unused argument?
The use case is probably in something more FP-related, such as in the .map example I gave in my article. In those cases you don't choose the arguments being passed to your function.
Oh, that's very true. In the map callback you may be interested only in the index, not the actual value, so you would use that trick in that instance. Got it, thanks!
I guess sometimes the shape of the arguments used to call your function are out of your control - e.g. event handlers; callbacks from other libraries etc. - and there may be times when you don't need all the arguments exposed in your function body. In which case you either define a parameter you don't use; or do this...
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.