I’ve saw two styles while reading built-in objects for JavaScript.
// Let's assume that all callback parameters are explained at h3.Parameters, regardless of its style.
someFunction(callback[, optionalArg]); // first style, callback params are not written here.
someFunction(callback(cbArg[, cbOptionalArg])[, optionalArg]) // second style, callback params are explicitly written here.
For the first example see Array.prototype.find().
For the second, see Array.prototype.findIndex().
Please note that find() was changed from the first to the second and reverted, which made me curious.
ECMA-262 6th edition uses the first style (Array.prototype.map( callbackfn [ , thisArg ] )) so is it safe to think that I should prefer callbacks without parameters?