If I have a JavaScript function taking an object as a parameter, I can describe expected properties of the object with JSDoc like this:
/**
* @param bar
* @param bar.baz {number}
* @param bar.qux {number}
*/
function foo(bar) {
return bar.baz + bar.qux;
}
How do I describe these properties if I define my function with ECMAScript 6 destructuring, not giving the real parameter object a name at all?
const foo = ({ baz, qux }) => baz + qux;
@param {Object} { bar, qux }
. Would be great to reffer bar an gux describing then this way, less code. – Concessionaire