javascript - How to document deconstructed parameters with JsDoc -


how document function parameter gets deconstructed in function arguments?

/**  * function deconstructs argument , stuff.  * @param {} *** should here? ***  */ function somefunction({ key1, key2, key3 }) {     // function stuffs } 

from @param wiki page:

if parameter destructured without explicit name, can give object appropriate 1 , document properties.

documenting destructuring parameter

/**  * assign project employee.  * @param {object} employee - employee responsible project.  * @param {string} employee.name - name of employee.  * @param {string} employee.department - employee's department.  */ project.prototype.assign = function({ name, department }) {     // ... }; 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -