Background
According to the MDN docs, Promise.prototype.catch() takes a parameter called onRejected, which is a function that is called when the Promise is rejected. (Internally, this calls Promise.prototype.then(undefined, onRejected).)
According to the docs, onRejected “has” one parameter, reason, which is the rejection reason. In the examples given, this parameter is always present.
E.g.,
p.catch(function(e) {
console.error(e);
})
Question
I am writing code where I do not want to use the reason parameter, so something like this:
p.catch(function(e) {
foo();
})
Is it better practice to leave in the e parameter, since according to the docs onRejected is supposed to have it? (ESLint will also complain about this).
Or is it common practice to remove it? As in
p.catch(function() {
foo();
})
PS: I know about optional catch binding, but that is for try-catch blocks.