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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -