Are there any standard ways of marking a function argument as unused in JavaScript, analogous to starting a method argument with an underscore in Ruby?
With browsers supporting destructuring one can do:
function ({}, {}, value) {
// console.log(value)
}
Which is kind of neat in that it avoids the problem of multiple arguments having the same name and also won't create problems with libraries that assign methods to _ (lodash, underscore, etc.).
One problem with this approach is that unused arguments of type undefined or null will throw.
For undefined one solution is to use default parameters:
function ({}={}, {}={}, value) {
// console.log(value)
}
Sadly no such easily applied solution for null.